Library to easily wrap data to GraphQL Pagination.
Implements Relay's GraphQL Cursor Connections Specification and supports Offset Pagination.
Designed in modular and extendable way.
Use built-in dataSourcePager
which provides GraphQL Resolver for your Graph.
By implementing / using built-in DataSource
you have full control how data is provided to the Pager.
You can use one of these provided:
- ArrayDataSource - bundled in @graphql-pagination/core module
- OffsetDataSourceWrapper - bundled in @graphql-pagination/core module
- SQL Knex - bundled in sql-knex module
- MongoDb - bundled in mongodb module
Or implement your own by implementing the DataSource interface.
There is no need for any special integration or dependency. Just use core pager.
In places where user's input is validated the proper GraphQLError
is thrown with extensions object containing code BAD_USER_INPUT
.
For more examples go to core package.