-
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
graphQLErrors
property passed to onError
is sometimes an empty string
#10590
Comments
Any update here. I am still having the |
That would likely come in as |
@6XGate this definitely seems like a bug, good catch! We should absolutely make sure that Would you be open to submitting a PR to get this fixed? I'd be more than happy to review it. |
Can if I get a chance. |
We're also seeing this for 502 errors 👍 |
This issue was fixed for new versions? |
@fe-jcorreia nope this is still an issue. I'm just realizing though that we have #11329 open to address this. We'll see if we can get a review on that one soon. Thanks for the nudge. |
I just ran into this issue for our product, causing us to not handle the errors properly and silently fail. Is there a chance we can get this PR merged at some point? @jerelmiller |
@Tadimsky gah thanks for the reminder. I've had a tab open to review it for a while and it kept slipping my mind. Just reviewed the PR that fixes this and will get it in the next patch release which should go out later this afternoon. |
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Issue Description
The type definitions for the
onError
link shows thatgraphQLErrors
should always be an array of errors. Unfortunately when some servers return a 500 error, it will be an empty string.Link to Reproduction
See repro steps
Currently I have to use the following code to prevent this from happening
Reproduction Steps
It is difficult to create a reproduction case with the given templates. Though I can if needed. But, the offending code is in at /src/link/error/index.ts:63 and may be a lack response parsing sanity checking or sanitation earlier on. It may also be that using a chaining of
&&
should be replaced with something that ensures the networkError result is an object and not something else.The text was updated successfully, but these errors were encountered: