-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fix type signature of ServerError #10810
Conversation
`result` can be a string
|
Name | Link |
---|---|
🔨 Latest commit | bd1e0fd |
@dleavitt: 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/ |
🦋 Changeset detectedLatest commit: f17b34b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Hi @dleavitt 👋 Thanks for opening this PR! You're correct that the behavior slightly changed here in 3.7: previously, if a request returned a response with >= 300 status code and string body, I've added a test case and small related TS fix: expanding |
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.
This looks great to me! Thanks for getting this fixed! 🎉
@alessbell good catch, thanks so much! |
ServerError#result
will be a string when the response has a >= 300 status code and isn't json.It looks like maybe there was a breaking change in parseAndCheckHttpResponse.ts when adding defer support in 3.7.
ServerParseError
. SoServerError
's result would always be JSON.ServerError
(with a string result) instead.Maybe this is a bug? The old behavior seems better.
Checklist: