最好使用
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
}
}
}
}
看看这篇文章”
Using Githubâs GraphQL to retrieve a list of repositories, their commits and some other stuffâââpart 2
“摘自F_bio Molinar,列出回购协议并应用该过滤器。
.