Skip to content

Instantly share code, notes, and snippets.

@dhruvdcoder
Created September 13, 2018 17:28
Show Gist options
  • Save dhruvdcoder/7519116c7f1ed91288f541c2d12b9122 to your computer and use it in GitHub Desktop.
Save dhruvdcoder/7519116c7f1ed91288f541c2d12b9122 to your computer and use it in GitHub Desktop.
Query to fetch information about any repository using github's graphql API
query repo_info($owner: String!, $name: String!){
repository(owner: $owner, name: $name) {
...RepoFragment
}
}
fragment RepoFragment on Repository {
name
stargazers {
totalCount
}
issues{
totalCount
}
forks{
totalCount
}
pullRequests{
totalCount
}
watchers{
totalCount
}
refs(first: 100, refPrefix: "refs/heads/") {
edges {
node {
name
target {
... on Commit {
id
history(first: 0) {
totalCount
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment