Page based pagination with Connections

There are no public examples of doing paged based pagination with Connection in Relay .

Page based is a very common pattern in business apps, so it should be easy in Relay.

Artsy made some prior work

but it feels not good to me

We can augment connection arguments to also include limit and offset to enable page based pagination.

We also need to modify Connection Handler (https://github.com/facebook/relay/blob/master/packages/relay-runtime/handlers/RelayDefaultHandlerProvider.js#L25), to make sure the edges are properly added to the right connection

Links to
  • RelayI'm known in open source mostly by my Relay contributions I'm also know because of react-native contributions Relay is a data fetching that scales, it let you declare which data…
Shares tags with
  • What people get wrong about RelayNode interface Connections Data components fragments vs queries where the data is stored (not in graphql operation, but in relay store) how to understand store
  • A mock GraphQL serviceThe idea is a simple Koa server that receives the schema.graphql in a body applies the mocks to it, and return a given query app.use(getSchemaFromBody()) app.use(graphql()) here…
  • Global StateRedux single immutable atom for the whole UI hard to code split hard to optimize Selector: useSelector Recoiljs multiple immutable atoms for the UI it works with sync and async…

Sign in with GitHub to reply.

Select any passage to quote it.

Comments