【发布时间】:2022-07-30 21:48:24
【问题描述】:
通过 Github 的 GraphQL API,我最近发现了“Github API: Getting topics of a Github repository”,它提到您可以获得主题计数:
{
repository(owner: "twbs", name: "bootstrap") {
repositoryTopics(first: 10) {
edges {
node {
topic {
name
}
}
}
}
}
}
但在文档和搜索中,我没有找到如何查询不包含主题 template 的存储库,例如:
query ($github_org: String!, $repo_count: Int!) {
organization(login: $github_org) {
repositories(first: $repo_count, privacy: PUBLIC, isFork: false) {
nodes {
id
name
openGraphImageUrl
createdAt
stargazerCount
url
description
repositoryTopics(first: 10, after: "template") {
edges {
node {
id
}
}
}
}
}
}
}
使用after 是否正确?在 Github 的 GraphQL API 中,如果存储库包含某个主题,如何排除它?
【问题讨论】:
-
嘿。这不是
after的正确用法。after参数用于传递要在“之后”获得结果的游标。您可以在页面对象中获取节点的光标。
标签: github graphql github-api github-graphql