-
Notifications
You must be signed in to change notification settings - Fork 13
Add max batch size config option #351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -416,7 +416,8 @@ function getBatchLoader(resourceConfig: BatchResourceConfig, resourcePath: Reado | |||||
| * flow errors :( | ||||||
| */ '' | ||||||
| } | ||||||
| ...cacheKeyOptions | ||||||
| ...cacheKeyOptions, | ||||||
| ${resourceConfig.maxBatchSize ? `maxBatchSize: ${resourceConfig.maxBatchSize},` : ''} | ||||||
| } | ||||||
| )`; | ||||||
| } | ||||||
|
|
@@ -514,7 +515,8 @@ function getPropertyBatchLoader(resourceConfig: BatchResourceConfig, resourcePat | |||||
| * flow errors :( | ||||||
| */ '' | ||||||
| } | ||||||
| ...cacheKeyOptions | ||||||
| ...cacheKeyOptions, | ||||||
| ${resourceConfig.maxBatchSize ? `maxBatchSize: ${resourceConfig.maxBatchSize},` : ''} | ||||||
|
||||||
| ${resourceConfig.maxBatchSize ? `maxBatchSize: ${resourceConfig.maxBatchSize},` : ''} | |
| ${resourceConfig.maxBatchSize !== undefined ? `maxBatchSize: ${resourceConfig.maxBatchSize},` : ''} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking this as falsy conditional cause I don't think we'd want to set a max batch size of 0 anyway.
But I can swap this to fall back to Infinity instead since that seems like what it defaults to under the hood anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 is probably not a valid value tbf here @mikoarce so we should be good to ignore this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to add this to getBatchLoader too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure if we had to, but we probably should since it's also about batched calls. I can add that in there too!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made change here: fec60be added a test for this one as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably want to update the docs as well https://sourcegraph.yelpcorp.com/Yelp/dataloader-codegen/-/blob/API_DOCS.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++ good catch, totally forgot about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New entry: 732f246
https://github.com/Yelp/dataloader-codegen/blob/add_maxBatchSize_config_option/API_DOCS.md