query {
user(login:"<any user name>"){ #Use "viewer" if you want to run it on your profile
repositories(orderBy: {field: STARGAZERS, direction: DESC}){
totalCount
}
followers{
totalCount
}
issues_sum:issues{
totalCount
}
issues_open:issues(states: OPEN){
totalCount
}
issues_closed:issues(states: CLOSED){
totalCount
}
pr_sum:pullRequests{
totalCount
}
pr_open:pullRequests(states: OPEN){
totalCount
}
pr_closed:pullRequests(states: CLOSED){
totalCount
}
pr_merged:pullRequests(states: MERGED){
totalCount
}
repositories(orderBy: {field: STARGAZERS, direction: DESC}){
nodes{
name
stargazers{
totalCount
}
watchers{
totalCount
}
forkCount
}
}
}
}
Use this to monitor and design apps to get notifications on important actions like follower count increase, watchers count increase, stargazer increase etc.
- Right now you exploit a bug(?) by calling
repositories
twice to ignore pagination when the number of repositories is less than 100. If it is more than 100 anyways you'd need pagination so rewrite this query with proper pagination. - Can we get stats like stargazers, watchers, issues, prs without iterating on repository nodes? If not, then why?