查询Github GraphQL时如何使用多个对象?
如果第二个对象被取消注释,以下内容将会中断:
query {
repository(owner:"rails", name:"rails") {
object(expression:"master") {
... on Commit {
history {
totalCount
}
}
}
# object(expression: "master:README.md") {... on Blob {byteSize}}
}
}
如何让它运作? THX
答案 0 :(得分:2)
使用别名:
query {
repository(owner:"rails", name:"rails") {
object(expression:"master") {
... on Commit {
history {
totalCount
}
}
},
second_object: object(expression: "master:README.md") {... on Blob {byteSize}}
}
}