Skip to content

Commit fdb240e

Browse files
committed
feat: expose preparePaginationResolver method
1 parent 5faf5e3 commit fdb240e

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/composeWithPagination.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
/* @flow */
22

33
import { TypeComposer } from 'graphql-compose';
4-
import { preparePaginationResolver } from './paginationResolver';
5-
6-
export type ComposeWithPaginationOpts = {
7-
findResolverName: string,
8-
countResolverName: string,
9-
perPage?: number,
10-
};
4+
import { preparePaginationResolver, type ComposeWithPaginationOpts } from './paginationResolver';
115

126
export function composeWithPagination(
137
typeComposer: TypeComposer,

src/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/* @flow */
22

33
import { composeWithPagination } from './composeWithPagination';
4+
import { preparePaginationResolver } from './paginationResolver';
45

56
export default composeWithPagination;
67

7-
export { composeWithPagination };
8+
export { composeWithPagination, preparePaginationResolver };
89

9-
export type { ComposeWithPaginationOpts } from './composeWithPagination';
10+
export type { ComposeWithPaginationOpts } from './paginationResolver';

src/paginationResolver.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,16 @@ import type {
88
ProjectionType,
99
} from 'graphql-compose';
1010
import type { GraphQLResolveInfo } from 'graphql-compose/lib/graphql';
11-
import type { ComposeWithPaginationOpts } from './composeWithPagination';
1211
import { preparePaginationTC } from './types/preparePaginationType';
1312

1413
const DEFAULT_PER_PAGE = 20;
1514

15+
export type ComposeWithPaginationOpts = {
16+
findResolverName: string,
17+
countResolverName: string,
18+
perPage?: number,
19+
};
20+
1621
export type PaginationResolveParams<TContext> = {
1722
source: any,
1823
args: {

0 commit comments

Comments
 (0)