-
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
Handling partial data with error(s) #14
Comments
Could you maybe make a RunKit notebook reproducing the problem, using nock to mock the response? Or start a pull request with a failing test? You could add it here: https://github.com/octokit/graphql.js/blob/master/test/error-test.js That would help me to look into it faster 🙏 |
Sure, I’m sorry for not doing that right away 😅. I’ll get on it ASAP. |
I've created a reproduction here: https://github.com/TimonVS/graphql.js/blob/partial-data-error-repro/test/error-test.js#L51 If you run the test it will throw you'll notice that it fails on this line: https://github.com/TimonVS/graphql.js/blob/partial-data-error-repro/test/error-test.js#L103, which means that |
The test looks great 👍 Could you start a pull request and we take it from there?
Good question, clearly a case I did not consider yet. Right now I think I would throw the error, but add |
Created a PR here: #15 |
fixed via #15 |
In some cases the API might return partial data with an error, e.g.:
https://github.com/octokit/graphql.js/blob/master/lib/graphql.js#L30 suggests that when the API returns partial data and an error it will just return the data. Now my question is, how can I know that the API returns an error? As far as I can see I can't get access to the error object.
The text was updated successfully, but these errors were encountered: