【问题标题】:Github GraphQl get REPOSITORY subscriber count and the list of subscribersGithub GraphQl 获取 REPOSITORY 订阅者数量和订阅者列表
【发布时间】:2019-03-25 11:13:40
【问题描述】:

我正在使用以下查询名称“android”搜索存储库

{
  search(query: "android", type: REPOSITORY, first: 50) {
    repositoryCount
    edges {

      node {
        ... on Repository {
          id
          name
          description
          forkCount
          owner{
            avatarUrl
          }
        }
      }
    }
  }
}

如何获取 REPOSITORY 订阅者数量和订阅者列表

提前谢谢:)

【问题讨论】:

  • 你是指watch仓库的人数吗?
  • @BertrandMartel 在 github V3 搜索中有subscribersUrl 链接......类似的东西

标签: android github graphql github-graphql


【解决方案1】:

您正在寻找watchers,v3 中使用的术语是subscribers,请查看this

{
  search(query: "android", type: REPOSITORY, first: 50) {
    repositoryCount
    edges {
      node {
        ... on Repository {
          nameWithOwner
          watchers(first: 100) {
            totalCount
            nodes{
              login
            }
          }
        }
      }
    }
  }
}

Try it in the explorer

【讨论】:

  • 这似乎比我的回答更准确。 +1
【解决方案2】:

GitHub API 本身没有“订阅者”的概念(最多是number of clones, over the last 14 days

GraphQL 本身具有notion of subcription,如described here,但它们不用于“存储库”。

【讨论】:

    猜你喜欢
    • 2021-02-23
    • 2021-08-16
    • 1970-01-01
    • 2014-10-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-23
    相关资源
    最近更新 更多