首先,我要检查回购中是否已存在分支。我需要先查看所有打开的分支。
query searhbranches {
repositoryOwner(login: "username"){
repository(name: "config-replica"){
name
[branches] // something like this but its not available
}
}
}
答案 0 :(得分:1)
您想查看refs
内的repository
节点。这是一个对我有用的示例查询:
{
repository(owner: "desktop", name: "desktop") {
refs(first: 50, refPrefix:"refs/heads/") {
nodes {
name
}
}
}
}
这是返回的内容:
{
"data": {
"repository": {
"refs": {
"nodes": [
{
"name": "add-lfs-path-lookup"
},
{
"name": "add-notes-lookup-to-parser"
},
{
"name": "ahead-behind-toggle-spike"
},
{
"name": "all-stash-functions"
},
...
]
}
}
}
}
...