Skip to content

Conversation

@magicmark
Copy link
Collaborator

This ended up being kind of two seperate efforts in one PR, sorry! 😬

Here's what's happening:

  • Add API_DOCS.md to provide full documentation for all of dataloader-codegen's options
  • Add some default error handling in the case that a resource returns an error - we don't want to blow up the whole batch
  • Add a new errorHandler option to the config to let folks override what happens to an error returned from a resource

});
});

test('batch endpoint (multiple requests, custom error handling)', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++, nice test

});

test('batch endpoint (multiple requests, error handling)', async () => {
test('batch endpoint that throws errors', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++, nice test.

Could we add one more test when the number of items are not match in request/response then throw BatchItemNotFound Error

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have these tests:

I've gone ahead and asserted that these are actually BatchItemNotFound errors now tho :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could probably do with some better organization of these tests :P

Copy link
Contributor

@ryanruanwork ryanruanwork left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Could be great to add more tests and make test fail on CI. We may need to run make test to meet the requirement of pre-commit hooks.

This ended up being kind of two seperate efforts in one PR, sorry!
Here's what's happening:

- Add API_DOCS.md to provide full documentation for all of dataloader-codegen's options
- Add some default error handling in the case that a resource returns an error - we don't want to blow up the whole batch
- Add a new `errorHandler` option to the config to let folks override what happens to an error returned from a resource
@magicmark magicmark merged commit cc9d03e into master Mar 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants