Skip to content

Commit 6b7b10f

Browse files
committed
feat: expose prepareConnectionResolver method
1 parent eeba09f commit 6b7b10f

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

src/composeWithConnection.js

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

33
import { TypeComposer } from 'graphql-compose';
4-
import { prepareConnectionResolver, type ConnectionSortMapOpts } from './connectionResolver';
5-
6-
export type ComposeWithConnectionOpts = {
7-
findResolverName: string,
8-
countResolverName: string,
9-
sort: ConnectionSortMapOpts,
10-
defaultLimit?: ?number,
11-
};
4+
import { prepareConnectionResolver } from './connectionResolver';
5+
import type { ComposeWithConnectionOpts } from './connectionResolver';
126

137
export function composeWithConnection(
148
typeComposer: TypeComposer,

src/connectionResolver.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@ import type { GraphQLResolveInfo } from 'graphql-compose/lib/graphql';
1212
import { prepareConnectionType } from './types/connectionType';
1313
import { prepareSortType } from './types/sortInputType';
1414
import { cursorToData, dataToCursor, type CursorDataType } from './cursor';
15-
import type { ComposeWithConnectionOpts } from './composeWithConnection';
15+
16+
export type ComposeWithConnectionOpts = {
17+
findResolverName: string,
18+
countResolverName: string,
19+
sort: ConnectionSortMapOpts,
20+
defaultLimit?: ?number,
21+
};
1622

1723
export type ConnectionSortOpts = {
1824
value: any,

src/index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22

33
import { composeWithConnection } from './composeWithConnection';
44
import { cursorToData, dataToCursor } from './cursor';
5+
import { prepareConnectionResolver } from './connectionResolver';
56

67
export default composeWithConnection;
78

8-
export { composeWithConnection, cursorToData, dataToCursor };
9+
export { composeWithConnection, prepareConnectionResolver, cursorToData, dataToCursor };
910

10-
export type { ComposeWithConnectionOpts } from './composeWithConnection';
11-
export type { ConnectionSortOpts, ConnectionSortMapOpts } from './connectionResolver';
11+
export type {
12+
ComposeWithConnectionOpts,
13+
ConnectionSortOpts,
14+
ConnectionSortMapOpts,
15+
} from './connectionResolver';

src/types/sortInputType.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
import { TypeComposer } from 'graphql-compose';
55
import { GraphQLEnumType } from 'graphql-compose/lib/graphql';
66
import { isFunction } from '../utils/is';
7-
import type { ComposeWithConnectionOpts } from '../composeWithConnection';
8-
import type { ConnectionSortOpts } from '../connectionResolver';
7+
import type { ConnectionSortOpts, ComposeWithConnectionOpts } from '../connectionResolver';
98

109
export function prepareSortType(
1110
typeComposer: TypeComposer,

0 commit comments

Comments
 (0)