Skip to content

DefaultErrorHandler returning "Internal Server Error(s)" for some GraphQLErrors caused by clients #162

Closed
@kagof

Description

@kagof

Our graph returns an "Internal Server Error(s) while executing query" error when a graphql.execution.NonNullableValueCoercedAsNullException or graphql.execution.InputMapDefinesTooManyFieldsException is thrown. Both of these error are core GraphQL-Java client errors caused by bad user data. I'm sure a few other errors also may be in this situation, but these are the only ones I've encountered so far.

I believe the issue lies with DefaultGraphQLErrorHandler::isClientError(GraphQLError). If the error is not an ExceptionWhileDataFetching (which these are not, since they occur before data fetching happens), then it just returns !(error instanceof Throwable). Since both of these errors are Throwables, they are not recognized as client errors. I'm not sure what the reasoning is behind this check so I may be missing something here, but it seems to me that it should be checking something else.

graphql-java version: 11.0
graphql-java-servlet version: 7.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions