GitHub API—获取存储库中作者的评论总数

GitHub API—获取存储库中作者的评论总数,github,github-api,Github,Github Api,我知道我可以通过以下方式获得给定用户打开的PRs数量: https://api.github.com/search/issues?q=is:pr+repo:<owner>/<repo>+author:<username>+is:open https://api.github.com/search/issues?q=is:pr+repo:/+作者:+is:打开 但是给定用户查看的PRs数量如何?这在v3(REST)API中似乎不可用,但我在v4(GraphQ

我知道我可以通过以下方式获得给定用户打开的PRs数量:

https://api.github.com/search/issues?q=is:pr+repo:<owner>/<repo>+author:<username>+is:open
https://api.github.com/search/issues?q=is:pr+repo:/+作者:+is:打开

但是给定用户查看的PRs数量如何?

这在v3(REST)API中似乎不可用,但我在v4(GraphQL)API中找到了
totalPullRequestReviewContributions

在进行GraphQL查询之后,您将得到这个JSON。只有
totalPullRequestReviewContributions
的编号应该更改

{
  "data": {
    "user": {
      "contributionsCollection": {
        "totalPullRequestReviewContributions": 80
      }
    }
  }
}

由于这是使用v4(GraphQL)API,您可以从GraphiQLAPI资源管理器中测试它:

太好了,谢谢!现在我只需要在repositoryfind上进行筛选:{user(login:){contributionscolection{pullRequestReviewContributionsByRepository{contributions{totalCount}存储库{name}}}
{
  "data": {
    "user": {
      "contributionsCollection": {
        "totalPullRequestReviewContributions": 80
      }
    }
  }
}