Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Readme.MD from Github Graphql API?

The v3 has a specific API for retrieving the readme.md file. But in the new V4 GraphQL, there is no such field in the Repository Object.

Does anyone know how to retrieve the readme file?

Thanks!

like image 644
user5435999 Avatar asked Sep 15 '17 23:09

user5435999


1 Answers

There is not yet a specific entity to get the README.md file, but you can retrieve it as you would normally retrieve any other file:

{
  repository(owner: "gitpoint", name: "git-point") {
    object(expression: "master:README.md") {
      ... on Blob {
        text
      }
    }
  }
}
like image 179
machour Avatar answered Oct 05 '22 19:10

machour



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!