gpt4 book ai didi

github - 如何使用 Github 的 v4 GraphQL API 按编号查询拉取请求?

转载 作者:行者123 更新时间:2023-12-05 01:10:07 26 4
gpt4 key购买 nike

我可以像这样查询第一个拉取请求:

query {
repository(owner: "test_owner", name: "test_name") {
pullRequests(first: 1) {
nodes {
id
number
title
}
}
}
}

但是如何根据编号查询某个拉取请求呢?

以下不起作用:

query {
repository(owner: "test_owner", name: "test_name") {
pullRequests(first: 1, number: 50) { <-- CANNOT FILTER BY `number`
nodes {
id
number
title
}
}
}
}

感谢您的帮助!

最佳答案

使用pullRequest而不是 pullRequests 连接:

Returns a single pull request from the current repository by number.

{
repository(owner: "nodejs", name: "node") {
pullRequest(number: 2) {
id
number
title
}
}
}

Try it in the explorer

关于github - 如何使用 Github 的 v4 GraphQL API 按编号查询拉取请求?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48155693/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com