Optimization: fix unnecessary `hasNextPage` select in some circumstances
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 625
- Avg merge
- 5h 23m
- Merged PRs (30d)
- 24
Description
This query shouldn't need a fetch for `hasNextPage` on messages connection since we can see there won't be a next page (because there's no limit):
```graphql
## expect(errors).toBeFalsy()
## expect(queries).toHaveLength(1);
{
forums(includeArchived: EXCLUSIVELY) {
name
messagesConnection(includeArchived: INHERIT) {
... @defer {
pageInfo {
hasNextPage
}
}
}
}
}
```
Similarly this non-deferred query should not contain the `array[null]` in the query where it's inlined:
```graphql
## expect(errors).toBeFalsy()
## expect(queries).toHaveLength(1);
## expect(queries[0]).not.toInclude("array[null")
{
forums(includeArchived: EXCLUSIVELY) {
name
messagesConnection(includeArchived: INHERIT) {
pageInfo {
hasNextPage
}
}
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.