Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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;
}