-
Notifications
You must be signed in to change notification settings - Fork 13
add new config to batch properties calls #299
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
Conversation
…y don't exist for a batch resource
Only |
src/index.ts
Outdated
/** | ||
* Throw erros when resource uses propertyBatchKey but doesn't match requirements | ||
*/ | ||
function verifyBatchPropertyResource(args: CLIArgs) { |
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.
As discussed, since this is quite Yelpy and relies on checking swagger stuff specifically (which this tool is currently opinionated about), I'd suggest keeping this logic but moving it to a seperate script that runs in our build, outside of this tool.
added benefit: we can remove the swaggerPath / httpMethod keys etc since we'll know how to map to it.
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.
Hmm, you mean move the script to ggs? But the propertyBatchKey
needs to be in dataloader-codegen, if anyone else uses propertyBatchKey
they won't have correct flow type.
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.
nvm, saw your other command!
script to enforce the swagger contract will be moved to Yelp-land. The review comments on those lines will be addressed there. |
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.
fix n ship, awesome stuff! 🎉🎉🎉
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.
fix n ship, awesome stuff! 🎉🎉🎉
@magicmark Hey Mark, thanks so much for the review!! I've addressed all your comments,do you want to take a final look? |
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.
🥳 🎉
Feature
Add a new config
propertyBatchKey
so that we are able to batch “properties” call.Only a specific kind of endpoint would benefit from this:
input parameters format:
response:
Status Quo
run
node build/swapi-server.js
underexample/swapi
, thegetFilmsV2
function will be called three times in a roll.after this change
run

node build/swapi-server.js
underexample/swapi
, thegetFilmsV2
function will be only be called once.And the flow type of response
Manual testing enforce optional properties
https://fluffy.yelpcorp.com/i/18BHFxFfJg0TgsWjWDwngS2c6D4WS8zS.html#L1,L7,L12,L15,L29,L35,L57
Note
I realized it's hard to build something perfect that works for different kinds of use cases. And it adds complexity for both reviewers and me. Given we don't have much time left for this project, I think we should only focus on to support the use case of batching SBP services calls and maybe in the future we can improve this more.
(Previous pr: #261)