@graphql-tools/executor@1.2.6
Patch Changes
-
#6038
02dd9acThanks @ardatan! - Some libraries likeundicithrow objects that are notErrorinstances when the response is tried to parse as JSON but failed.
In that case, executor prints an error like below;NonErrorThrown: Unexpected error value: {...} at toError (/usr/src/app/node_modules/graphql/jsutils/toError.js:16:7) at locatedError (/usr/src/app/node_modules/graphql/error/locatedError.js:20:46) at /usr/src/app/node_modules/@graphql-tools/executor/cjs/execution/execute.js:330:58 at processTicksAndRejections (node:internal/process/task_queues:95:5) at async /usr/src/app/node_modules/@graphql-tools/executor/cjs/execution/promiseForObject.js:18:35 at async Promise.all (index 0)But actually the shape of the object matches the
Errorinterface.
In that case, the executor now coerces the object to anErrorinstance by takingmessage,stack,nameandcauseproperties.
So the user will get the error correctly.