github graphql查询项目贡献者

Pio*_*ski 5 graph github graphql github-graphql

我想使用GitHub Graphql api向项目贡献者进行查询,任何人都可以给我一些如何制作它的提示吗?尝试了一段时间,我想我缺少了一些小要素。

我想得到像https://api.github.com/repos/facebook/react/contributors?page=15之类的东西,但仅用于贡献量

问候!

sre*_*vas 2

更新时间:2020 年 5 月。

Github GraphQL API 目前不支持获取contributors存储库。

虽然你可以得到collaborators......

query {
  repository(owner: "peek", name: "peek") {
    id
    name

    collaborators(first: 10, affiliation: ALL) {
      edges {
        permission
        node {
          id
          login
          name
        }
      }
    }
  }

  rateLimit {
    cost
  }
}
Run Code Online (Sandbox Code Playgroud)

您需要拥有存储库的推送权限才能查看协作者。

  • 这是合作者,而不是贡献者。您无法(截至 2018 年 4 月)通过 GraphQL API 获取与“/repos/$USER/$REPO/contributors”等效的 v3 API。 (19认同)