Skip to content

Commit 2fc418d

Browse files
committed
Add maxBatchSize dataloader config support
1 parent f1ff4c4 commit 2fc418d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export interface BatchResourceConfig {
2828
isBatchKeyASet?: boolean;
2929
propertyBatchKey?: string;
3030
responseKey?: string;
31+
maxBatchSize?: number;
3132
}
3233

3334
export interface NonBatchResourceConfig {

src/implementation.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,8 @@ function getPropertyBatchLoader(resourceConfig: BatchResourceConfig, resourcePat
514514
* flow errors :(
515515
*/ ''
516516
}
517-
...cacheKeyOptions
517+
...cacheKeyOptions,
518+
${resourceConfig.maxBatchSize ? `maxBatchSize: ${resourceConfig.maxBatchSize},` : ''}
518519
}
519520
)`;
520521
}

0 commit comments

Comments
 (0)