Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kagof opened this issue Apr 12, 2019 · 1 comment
Milestone

Comments

@kagof
Copy link

kagof commented Apr 12, 2019

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

@oliemansm
Copy link
Member

oliemansm commented Jun 20, 2019

Looks like this check was added as a temporary fix because of a bug in graphql-java 3.0.0, and was never reverted. I'll revert it now for 7.5.1. See also #37

@oliemansm oliemansm added this to the 7.5.1 milestone Jun 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants