Replies: 3 comments 7 replies
-
/cc @jmartisk, @phillip-kruger |
Beta Was this translation helpful? Give feedback.
-
This is the correct behavior. We follow the GraphQL over HTTP Spec (see https://github.com/graphql/graphql-over-http/blob/main/spec/GraphQLOverHTTP.md) GraphQL will return 200 with the errors in the error fields. GraphQL is not tightly coupled with HTTP. In Quarkus you might want to set I am going to move this to a discussion. |
Beta Was this translation helpful? Give feedback.
-
Ok, but the specification says the following: A server MAY forbid individual requests by a client to any endpoint for any reason, for example to require authentication or payment; when doing so it SHOULD use the relevant 4xx or 5xx status code. This decision SHOULD NOT be based on the contents of a well formed GraphQL request. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
Setup:
Quarkus with SmallRye GraphQL, OIDC with Keycloak.
When securing the endpoints with @RolesAllowed if the user(token) does not have the required roles a ForbiddenException is thrown but the request comes back with status 200 and DataFetchingError instead of 401 or 403.
Expected behavior
Response has proper message and error code.
Actual behavior
Response comes back with status 200 and DataFetching exception
How to Reproduce?
Steps to reproduce:
Output of
uname -a
orver
No response
Output of
java -version
17
GraalVM version (if different from Java)
No response
Quarkus version or git rev
1.8.0.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
Beta Was this translation helpful? Give feedback.
All reactions