Skip to content

Instantly share code, notes, and snippets.

@davidcelis
Created December 6, 2016 19:28
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save davidcelis/dd85095ac46e159b9efe420687aaa7e9 to your computer and use it in GitHub Desktop.
Save davidcelis/dd85095ac46e159b9efe420687aaa7e9 to your computer and use it in GitHub Desktop.
An example GraphQL query to get `git blame` data from the GitHub GraphQL API
query {
repositoryOwner(login: "github") {
repository(name: "linguist") {
object(expression: "master") {
... on Commit {
blame(path: "github-linguist.gemspec") {
ranges {
startingLine
endingLine
age
commit {
oid
author {
name
}
}
}
}
}
}
}
}
}
@Phalguna2125
Copy link

@davidcelis Hi , thanke for the query.. is there a way to add restrictions on startingline and endingline values to fetch only those values.

Help is much appreciated.thank you

@davidcelis
Copy link
Author

@Phalguna2125 Not directly in the query; ranges doesn't support any arguments. But, it does just return an array as opposed to a paginated collection, so clients can just filter by startingLine and endingLine themselves

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment