Skip to content

Commit 7d0fa38

Browse files
forward maxBatchSize option to dataloader
1 parent e46382c commit 7d0fa38

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/BatchedGraphQLClient.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,18 @@ export class BatchedGraphQLClient {
2020
if (options && typeof options.cacheResults !== 'undefined') {
2121
delete options.cacheResults
2222
}
23+
24+
const maxBatchSize =
25+
options && typeof options.maxBatchSize !== 'undefined'
26+
? options.maxBatchSize
27+
: null
28+
29+
if (options && typeof options.maxBatchSize !== 'undefined') {
30+
delete options.maxBatchSize
31+
}
2332

2433
this.options = options || {}
25-
this.dataloader = new DataLoader(this.load, { cache })
34+
this.dataloader = new DataLoader(this.load, { cache, maxBatchSize })
2635
}
2736

2837
async request<T extends any>(

0 commit comments

Comments
 (0)