Skip to content

Commit dac2512

Browse files
committed
feat: Add defaultLimit option
1 parent 0d03239 commit dac2512

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/composeWithConnection.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export type ComposeWithConnectionOpts = {
77
findResolverName: string,
88
countResolverName: string,
99
sort: ConnectionSortMapOpts,
10+
defaultLimit?: ?number,
1011
};
1112

1213
export function composeWithConnection(

src/connectionResolver.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export function prepareConnectionResolver<TSource, TContext>(
206206
first = parseInt(first, 10) || 0;
207207
}
208208

209-
let limit = last || first || 20;
209+
let limit = last || first || opts.defaultLimit || 20;
210210
let skip = last > 0 ? first - last : 0;
211211

212212
let prepareCursorData;

0 commit comments

Comments
 (0)