-
Notifications
You must be signed in to change notification settings - Fork 301
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
bug: UnknownOperationException should return 400 instead of 500 #1751
Labels
bug
Something isn't working
Comments
Looks like I don't have access to create a branch/submit a pull request. Can I get access? Otherwise I can just share the code here. |
The common workflow on Github is to fork the repo to your personal account, and create a PR from there to the the main repo. |
kilink
pushed a commit
that referenced
this issue
Jan 2, 2024
When GraphQL.executeAsync throws UnknownOperationException, or any exception implementing GraphQLError, set the status to BAD_REQUEST / 400 in BaseDgsQueryExecutor. Fixes #1751.
kilink
pushed a commit
that referenced
this issue
Jan 8, 2024
When GraphQL.executeAsync throws UnknownOperationException, or any exception implementing GraphQLError, set the status to BAD_REQUEST / 400 in BaseDgsQueryExecutor. Fixes #1751.
kilink
pushed a commit
that referenced
this issue
Jan 9, 2024
When GraphQL.executeAsync throws UnknownOperationException, or any exception implementing GraphQLError, set the status to BAD_REQUEST / 400 in BaseDgsQueryExecutor. Fixes #1751.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected behavior
{ "operationName": "books", "variables": {}, "query": "{ books {\nid\nname\n} }" }
When this type of request/query is submitted (note, the operationName "books" without a matching named query), an UnknownOperationException is thrown from graphql.language.NodeUtil. When an UnknownOperationException is thrown, the result should be ResponseEntity.badRequest... since it is a malformed request.
Actual behavior
When this type of query is submitted and an UnknownOperationException is thrown, the current behavior is that an Internal Server Error is returned to the caller.
Steps to reproduce
Submit a named query with non-matching operationName. Or submit a non-named query with any operationName specified. Or submit two named queries without an operationName specified.
The text was updated successfully, but these errors were encountered: