Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.

fix(core): Allow permissive passthrough for CombinedError.graphQLErrors (#3087)

Changed files
+10 -1
.changeset
packages
core
src
utils
+5
.changeset/pink-penguins-grin.md
···
+
---
+
'@urql/core': patch
+
---
+
+
Allow any object fitting the `GraphQLError` shape to rehydrate without passing through a `GraphQLError` constructor in `CombinedError`.
+5 -1
packages/core/src/utils/error.ts
···
};
const rehydrateGraphQlError = (error: any): GraphQLError => {
-
if (error instanceof GraphQLError) {
+
if (
+
error &&
+
error.message &&
+
(error.extensions || error.name === 'GraphQLError')
+
) {
return error;
} else if (typeof error === 'object' && error.message) {
return new GraphQLError(