GITHUB API v4-按问题数量订购存储库

时间:2018-10-23 00:59:42

标签: git github github-api

如何根据打开的问题数从查询中订购存储库?

https://developer.github.com/v4/input_object/repositoryorder/

1 个答案:

答案 0 :(得分:0)

最好使用GitHub GraphQL V4

  

GitHub为我们的API v4选择了GraphQL,因为它为集成商提供了更大的灵活性。
  与REST API v3终结点相比,能够精确定义所需数据(并且仅包含所需数据)的功能是一项强大的优势。
  GraphQL允许您通过一次调用替换多个REST请求,以获取您指定的数据

例如,您可以通过以下方式get the total number of issues进行回购:

{
  repository(owner: "facebook", name:"react") {
    issues {
      totalCount 
    }
  }
}
  

返回:

{
  "data": {
    "repository": {
      "issues": {
        "totalCount": 5308
      }
    }
  }
}

查看FábioMolinar的文章“ Using Github’s GraphQL to retrieve a list of repositories, their commits and some other stuff — part 2”,以列出存储库并应用该过滤器。

相关问题