Our GraphQL pagination types are a year out of date #5982
Description
PageInfo type
While looking to use PageInfo
for search pagination, I found we already have a PageInfo
type:
But it only contains hasNextPage
and doesn't contain any notion of cursors of previous pages as the link in the docstring does: https://facebook.github.io/relay/graphql/connections.htm#sec-undefined.PageInfo
In fact, it doesn't even match the "Relay Legacy" definition, which -- quoting the docs -- contains cursors and edges still:
Relay Legacy did not define startCursor and endCursor, and relied on selecting the cursor of each edge; Relay Modern began selecting startCursor and endCursor instead to save bandwidth (since it doesn’t use any cursors in between).
Connection objects
According to the Relay Modern specification, connection types must contain an edges
field: https://facebook.github.io/relay/graphql/connections.htm#sec-Edges
Our connection objects only declare nodes
, even in recently added APIs like campaigns:
Using GitHub's API as a reference, it appears we should have both nodes
and edges
:
https://developer.github.com/v4/object/marketplacelistingconnection/