graphql / graphql/graphql-relay-js
PageInfo type field nullability different from specification
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 177
- Avg merge
- 10m
- Merged PRs (30d)
- 1
Description
The [relay spec says](https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo.Fields) that "`PageInfo` must contain fields `hasPreviousPage` and `hasNextPage`, both of which return _non‐null_ booleans. It must also contain fields `startCursor` and `endCursor`, both of which return _non‐null_ opaque strings."
However, the [Flow type for PageInfo](https://github.com/graphql/graphql-relay-js/blob/ecc478e7f6ed74c233aa53bbf5e9d4e04dffeada/src/connection/connectiontypes.js#L18) makes all of them nullable, and the [GraphQL object type for PageInfo](https://github.com/graphql/graphql-relay-js/blob/ecc478e7f6ed74c233aa53bbf5e9d4e04dffeada/src/connection/connection.js#L135) makes `startCursor` and `endCursor` nullable.
Can we fix these types to conform to the specification?
Contributor guide
Assessment
This issue has not been assessed yet.