graphql - GitHub GraphQL api 说还有另一个页面,但是使用游标时找不到结果
问题描述
我有一个基本查询来获取有关某些问题的信息。
query getIssues($owner: String!, $repo: String!, $milestoneId: Int!, $cursor:String) {
repository(owner: $owner, name: $repo) {
milestone(number: $milestoneId) {
title
issues(first: 100, after:$cursor) {
totalCount
edges {
node {
title
state
createdAt
closedAt
}
}
pageInfo
{
hasNextPage
endCursor
}
}
}
}
}
当我使用参数时:
{"owner": "Me", "repo": "MyRepo", "milestoneId": 1, "cursor": null}
我收到有关前 100 个问题的信息。有一个totalCount
213,paginationInfo
告诉我还有另一页,并给我一个光标转到下一页。
当我执行另一个查询时,将字段$cursor
替换为由endCursor
. 我收到这个作为答案:
{
"data": {
"repository": {
"milestone": {
"title": "MilestoneName",
"issues": {
"totalCount": 213,
"edges": [],
"pageInfo": {
"hasNextPage": false,
"endCursor": null
}
}
}
}
}
}
是否有额外的步骤来使用光标进行分页工作?
解决方案
推荐阅读
- java - 更改图像颜色
- node.js - 我刚开始使用 angular 和 jodejs,我想将 xml 转换为 json,我对 xmltojson 和 xml2json npm 模块感到困惑?
- hyperledger-fabric - 何时在超级账本结构网络中创建组织?
- ios - 如何使用 AFNetworking 检测删除状态?
- python - 数据框列中的时间差
- java - JPEG如何在解码文件流时跳过用户定义的标签
- php - SyntaxError:意外的令牌 < 在 JSON 中的位置 0 php
- android - 可移动的浮动操作按钮
- javascript - 如何使图像指向一个按钮(我有多个版本,每个版本都指向一个特定的按钮)
- jquery - 我想根据使用jQuery向下拉框动态添加的类向下拉框的父级添加一个类