-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
Using Graphql 0.13.2
Executing graphql natively as follows through AWS Lambda:
index.js - calls
const runGraphQL = (query, variables, params) => {
return graphql(schema, query, null, {params}, variables)
}
If the executing code throws an error, it usually returns message as string with [object, Object]. I suspect it wraps to GraphQLError. If I wrap the above error object using GraphQLError then I do not get anything back and my response.errors is an empty object {}. The only way I am able to get back data properly is to return an Error as a string or a GraphQLError as a string, I am unable to push back an object.
Oddly enough if I run GraphQL with express and add the formatError with an error handler then that works, however using it natively it does not.
It seems that I am missing something simple to get GraphQL to return the object instead of only working with strings. Any ideas?