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
If I make a request that is illegal because the input arguments/variables are the wrong type, I would expect Apollo to emit a ValidationError. Instead, the more generic GraphQLError is thrown.
produces an error object (passed to formatError) that looks something like:
{
"message": "Variable \"$userId\" of non-null type \"Int!\" must not be null.",
"name":"GraphQLError"
}
Because these errors are typically the result of a bad client request, I would like to have some sort of mechanism where I can ensure that they are logged with a lower severity (compared to an actual execution error).
The text was updated successfully, but these errors were encountered:
I wasn't able to locate a good point where Apollo could unambiguously intercept these errors 😕and convert them to ValidationErrors – I wonder if this is a change that would need to be made in graphql-js itself....
Is there currently any discussion ongoing on changing this behaviour you mentioned? Would this involve changing the GraphQL spec or is this something that must be handled inside the implementations (such as graphql-js)?
If I make a request that is illegal because the input arguments/variables are the wrong type, I would expect Apollo to emit a
ValidationError
. Instead, the more genericGraphQLError
is thrown.A very naive example:
This Query:
with the variables:
produces an error object (passed to
formatError
) that looks something like:Because these errors are typically the result of a bad client request, I would like to have some sort of mechanism where I can ensure that they are logged with a lower severity (compared to an actual execution error).
The text was updated successfully, but these errors were encountered: