-
Notifications
You must be signed in to change notification settings - Fork 87
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
Add test for handling partial data with error(s) #15
Conversation
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 part of this Pull Request we should also add a section for Partial responses
to the README.md
|
||
.then(result => { | ||
throw new Error('Should not resolve') | ||
}) |
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.
if you agree, we could add a .catch()
statement similar to the test above, only also check for error.data
. Would that be a desired behavior for partial responses?
}) | |
}) | |
.catch(error => { | |
expect(error.message).to.equal('Field \'bioHtml\' doesn\'t exist on type \'User\'') | |
expect(error.errors).to.deep.equal(mockResponse.errors) | |
expect(error.request.query).to.equal(query) | |
expect(error.data).to.deep.equal(mockResponse.data) | |
}) |
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.
Yes, I think that would make the most sense!
@gr2m I updated the test and made it pass, I also added a section to the readme. Let me know what you think :) |
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.
Fabulous! Thank you Timon 💝
🎉 This PR is included in version 2.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Ref: #14