如何从 GraphQL 按自定义字段查询 GitHub 项目 V2 项目订单?

问题描述 投票:0回答:1

如何从 API 获取看板视图列中项目的顺序?我在

sortBy
ProjectV2
中找到了
views
对象,但我正在努力查询按
items
(位置?)排序的
fieldValue

您介意帮我构造一个与图片中数据等效的 JSON 查询吗?

image

github graphql github-api github-graphql
1个回答
0
投票

我找到一个例子,可能会有所帮助。

您可以使用

orderBy: {field: CREATED_AT, direction: ASC}
,如下所示。

query MyQuery {
  repository(name: "dbeaver", owner: "dbeaver") {
    issues(first: 100, filterBy: {labels: "bug", createdBy: "2022-01-01..*"}, orderBy: {field: CREATED_AT, direction: ASC}) {
      edges {
        node {
          createdAt
          labels(first: 100) {
            edges {
              node {
                name
              }
            }
          }
        }
      }
      totalCount
    }
  }
}
© www.soinside.com 2019 - 2024. All rights reserved.