M
M
monochromer2022-01-27 22:05:54
GitHub
monochromer, 2022-01-27 22:05:54

How to get the number of issues and pull requests of multiple users in one repository using the Github GraphQL API?

To solve the problem, I use the following query (query)

search(query: "repo:repoName type:issue author:authorName", type: ISSUE) {
  issueCount
}


By changing the type typeto issueand pryou can get data for one user authorName:
query {
  issues: search(query: "repo:repoName type:issue author:authorName", type: ISSUE) {
    issueCount
  }
  pr: search(query: "repo:repoName type:pr author:authorName", type: ISSUE) {
    issueCount
  }
}


How to get similar data for multiple users in one request?

That is, the output would be something like:
{
  user1: {
   issues: { issueCount: 123 },
   pr: { issueCount: 123 }
  },
  user2: {
   issues: { issueCount: 123 },
   pr: { issueCount: 123 }
  }
  // ...
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question