Created
September 13, 2018 17:28
-
-
Save dhruvdcoder/7519116c7f1ed91288f541c2d12b9122 to your computer and use it in GitHub Desktop.
Query to fetch information about any repository using github's graphql API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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