apollo-client
apollo-client copied to clipboard
Fix for ServerError obscured by ServerParseError
Fixes #8945 where not handling the response status code before parsing the response body text causes the apollo client to send a ServerParseError when it should send a ServerError.
The changes here are taken from #8974 which has been inactive for months
@dillontiner: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/
@dillontiner Thanks for follow up on this and our apologies for the lingering PR review, we'll check this out soon. 🙏
This seems to be failing the NPM Bundle Size check
LGTM. I went ahead and added some extra tests - we're now testing unparsable JSON with both 200 and 400 server response codes. Other than that, I'm glad to get this merged! Thanks a ton @TakahiroHimi for the original PR and @dillontiner for keeping the fix alive.
All the best, Emmanuel, Intern :-)