Open n1ru4l opened 1 year ago
I created the following PR for resolving this within GraphQL Hive: https://github.com/kamilkisiela/graphql-hive/pull/2299
This logic could potentially life in the useMaskedErrors
plugin. 🤔
But how are serialisation errors unexpected errors? I mean, maybe the variables are wrongly provided by the user and he should be warned (using GQLError) instead of everything blowing up?
Compared to null for non-nullable
, this is definitely an issue and should blow.
I misinterpreted, this is about serialisation - yeah, I agree then, serialisation issues should be errors.
Breakdown
These errors thrown within graphql scalar types
serialize
function are unreported but should IMHO as this indicates something wrong within the GraphQL resolvers.However, it is currently hard to catch these due to how we detect "unexpected" errors. Any
GraphQLError
that has anoriginalError
property that is not aGraphQLError
is considered an unexpected error. AnyGraphQLError
that has anoriginalError
property which is aGraphQLError
is considered an expected error.This feels a bit inconsistent with how errors are asserted in other places. E.g. a resolver field non-
null
check will raise anError
instead of aGraphQLError
.Possible solutions for the problem
Error
instead ofGraphQLError
within the scalar functions.