graphql-compose-pagination
TypeScript icon, indicating that this package has built-in type declarations

8.3.0 • Public • Published

graphql-compose-pagination

travis build codecov coverage npm trend Commitizen friendly

This is a plugin for graphql-compose family, which adds to the ObjectTypeComposer pagination resolver.

Live demo: https://graphql-compose.herokuapp.com/

CHANGELOG

Installation

npm install graphql graphql-compose graphql-compose-pagination --save

Modules graphql and graphql-compose are in peerDependencies, so should be installed explicitly in your app. They should not installed as sub-modules, cause internally checks the classes instances.

Example

import { preparePaginationResolver } from 'graphql-compose-pagination';
import { UserTC, findManyResolver, countResolver } from './user';

const paginationResolver = preparePaginationResolver(UserTC, {
  findManyResolver,
  countResolver,
  name: 'pagination', // Default
  perPage: 20, // Default
});

Implementation of findManyResolver and countResolver can be found in this file.

screen shot 2017-08-07 at 23 31 46

Used in plugins

graphql-compose-mongoose – converts mongoose models to graphql types

License

MIT

Dependents (16)

Package Sidebar

Install

npm i graphql-compose-pagination

Weekly Downloads

6,382

Version

8.3.0

License

MIT

Unpacked Size

25.7 kB

Total Files

20

Last publish

Collaborators

  • nodkz