Skip to content

Instantly share code, notes, and snippets.

@gjtorikian
Last active February 22, 2019 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gjtorikian/7c53efc1ec6284472b4ea1d9883babd5 to your computer and use it in GitHub Desktop.
Save gjtorikian/7c53efc1ec6284472b4ea1d9883babd5 to your computer and use it in GitHub Desktop.
sample GQL query for fetching files via GitHub GQL API
{
# get a list of files off the tree entries
repository(owner: "gjtorikian", name: "html-proofer") {
ref(qualifiedName: "refs/heads/master") {
target {
... on Commit {
tree {
entries {
object {
__typename
... on Blob {
id
text
}
}
}
}
}
}
}
}
# or lookup directly off of a node
node(id: "MDQ6QmxvYjg0NTE4OTM6ZGExMzJmOTIxMDVjZGQxMGVhYjViMjVhMGZlNmRhNGQ0MGJiOWIyOQ==") {
__typename
... on Blob {
text
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment