You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Intended outcome:
It's not very useful to have [object Object] come back as an error string. Maybe check to see if you can JSON.stringify it first and return that string instead.
Actual outcome:
Errors that have objects as messages come back as "GraphQL error: [object Object]"
How to reproduce the issue:
Have a graphql server return an error message as an object. If this is not a good pattern, how else can we supply object shaped data as an error? Sure, we could stringify it, but then to do something with it, we would need to parse it after we remove that "GraphQL error:" part.
Versions
latest,
2.4.6
The text was updated successfully, but these errors were encountered:
Related code:
apollo-client/packages/apollo-client/src/errors/ApolloError.ts
Line 19 in 12bd15f
Intended outcome:
It's not very useful to have [object Object] come back as an error string. Maybe check to see if you can JSON.stringify it first and return that string instead.
Actual outcome:
Errors that have objects as messages come back as "GraphQL error: [object Object]"
How to reproduce the issue:
Have a graphql server return an error message as an object. If this is not a good pattern, how else can we supply object shaped data as an error? Sure, we could stringify it, but then to do something with it, we would need to parse it after we remove that "GraphQL error:" part.
Versions
latest,
2.4.6
The text was updated successfully, but these errors were encountered: