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
I setup logging GraphQL errors on Sentry.io and got several issues with GraphQLError
1. Determining a type of the error:
RuntimeError (when resolvers throw errors on execution) or InvalidQuery (when provided invalid query). Right now I qualify a type of error via GraphQLError.pathproperty. If it is empty then I got InvalidQuery, if it is an array then RuntimeError.
What do you think about additional Error objects GraphQLRuntimeError, GraphQLInvalidQueryError (inherited from GraphQLError)?
2. Lack of context and variables in GraphQLError
Query I can get via GraphQLError.source.body, but did not found a proper way how to get variables and context.
Diving down to GraphQLError.nodes for obtaining variables is too complicated.
Passing context to formatError when defining express-graphql middleware is possible. But looks weird.
So will be cool if these properties somehow will be added to the GraphQLError.
I setup logging GraphQL errors on Sentry.io and got several issues with GraphQLError
1. Determining a type of the error:
RuntimeError (when resolvers throw errors on execution) or InvalidQuery (when provided invalid query). Right now I qualify a type of error via
GraphQLError.path
property. If it is empty then I got InvalidQuery, if it is an array then RuntimeError.What do you think about additional Error objects GraphQLRuntimeError, GraphQLInvalidQueryError (inherited from GraphQLError)?
2. Lack of
context
andvariables
in GraphQLErrorQuery I can get via
GraphQLError.source.body
, but did not found a proper way how to get variables and context.Diving down to
GraphQLError.nodes
for obtaining variables is too complicated.Passing context to
formatError
when definingexpress-graphql
middleware is possible. But looks weird.So will be cool if these properties somehow will be added to the GraphQLError.
@leebyron @schrockn what do you think about improving error object?
Some examples of error events which I got with my error catch setup for sentry.io
The text was updated successfully, but these errors were encountered: