I'm looking for a way to use the GitHub GraphQL to read repository contents (paths) and then provide a second query to grab the contents of the full path. I started heading down this path for the second query, and it's failing. The former is the more important issue for me right now.
query{
viewer {
login
name
repository(name:"myrepo") {
id
descriptionHTML
object(expression: "branch:readme.md") {
id
}
}
}
}
}
You had an extra } in your query, this is why it was failing. You also want to replace "branch" with the actual branch name ("master" for example)
Here's a complete example that will also get you the file contents: