-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
We are upgrading to latest graphql and express graphql in our Node app from very old versions (graphql 0.8, graphqlexpress 0.7). In doing so we lose the error response data in our underlying api calls graphql is making. I traced the issue here.
graphql-js/src/execution/execute.js
Line 715 in d85fc11
| if (error instanceof Error) { |
At one point in the older releases, an error object with a nested originalError was returned. Now instead I get only a string back.
If instead of doing new Error(error.errorString) the code would call new GraphQLError(...,...,...,error) where error is the originalError part, then I can extract the data from my error object in the graphql express module as referenced here : https://github.com/graphql/express-graphql/blob/master/README.md#debugging-tips
At one point the code must have returned an error that wrapped the originalError object and now it does not, it only returns an error that wraps a string.