You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling ClientResponseField.toEntity(someClass) on a field that cannot be deserialized into the given type, the method will throw an HttpMessageNotReadableException.
Spring MVC's ResponseEntityExceptionHandler will unfortunately convert this into a 400 Bad Request response, while this error should actually be treated as an internal server error. (The error was caused because the GraphQL response could not be read.)
It would be nice if ClientResponseField.toEntity could wrap this exception in a way that distinguishes it from actual client errors.
Spring GraphQL version: 1.4.0
The text was updated successfully, but these errors were encountered:
That makes sense. Methods to access the response already throw FieldAccessExceptions, an extension of GraphQlClientException. We could wrap any others as GraphQlClientException similar to what RestClient does for such errors.
rstoyanchev
changed the title
ClientResponseField.toEntity throws HttpMessageNotReadableException
Methods that access the resopnse should raise GraphQlException consistently
May 29, 2025
When calling
ClientResponseField.toEntity(someClass)
on a field that cannot be deserialized into the given type, the method will throw anHttpMessageNotReadableException
.Spring MVC's
ResponseEntityExceptionHandler
will unfortunately convert this into a400 Bad Request
response, while this error should actually be treated as an internal server error. (The error was caused because the GraphQL response could not be read.)It would be nice if
ClientResponseField.toEntity
could wrap this exception in a way that distinguishes it from actual client errors.Spring GraphQL version: 1.4.0
The text was updated successfully, but these errors were encountered: