How to use the graphql-compose-pagination.preparePaginationResolver function in graphql-compose-pagination

To help you get started, we’ve selected a few graphql-compose-pagination examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github graphql-compose / graphql-compose-mongoose / src / resolvers / pagination.js View on Github external
opts?: PaginationResolverOpts
): ?Resolver {
  try {
    require.resolve('graphql-compose-pagination');
  } catch (e) {
    return undefined;
  }
  const preparePaginationResolver = require('graphql-compose-pagination').preparePaginationResolver;

  if (!preparePaginationResolver) {
    throw new Error(
      'You should update `graphql-compose-pagination` package till 3.3.0 version or above'
    );
  }

  const resolver = preparePaginationResolver(tc, {
    findResolverName: 'findMany',
    countResolverName: 'count',
    ...opts,
  });

  return resolver;
}

graphql-compose-pagination

Plugin for `graphql-compose` which provide a pagination resolver for types.

MIT
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis

Popular graphql-compose-pagination functions