apollographql / apollographql/fullstack-tutorial
Error when fetching past end of Launches
- 主要语言
- TypeScript
- 星标
- 1.2k
- 派生
- 808
- PR 合并指标
- 30 天内没有已合并 PR
描述
Cursor is defined as non-nullable:
```
type LaunchConnection { # add this below the Query type as an additional type.
cursor: String!
hasMore: Boolean!
launches: [Launch]!
}
```
But if no launches are retrieved (for example if you pass in a cursor for which `hasMore` was false), then the code will carefully return `null` for the cursor:
```
return {
launches,
cursor: launches.length ? launches[launches.length - 1].cursor : null,
```
Resulting in INTERNAL_SERVER_ERROR:
贡献指南
这个仓库没有索引到贡献指南
调研方向
从 Query 类型下面的 LaunchConnection schema 和 issue 中所示的 resolver 返回对象开始。使用超出 launches 末尾的 cursor 重现一个请求,然后使 schema 和返回的 cursor 行为保持一致。完成的标准是该请求返回有效的 GraphQL 响应,而不是 INTERNAL_SERVER_ERROR。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- graphql, typescript
- 领域
- api, backend
- Issue 类型
- 缺陷
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 52/100