-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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. |
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: