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
we are using http4k with the GraphQL-java library and experience some malfunction while transforming ExecutionResult to GraphQLResponse using GraphQLResponse.from. The exception reads as this:
Cannot construct instance of `java.util.LinkedHashMap` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('graphql.execution.NonNullableValueCoercedAsNullException:...
Looking into the issue, it seems that ExecutionResult can be populated by the GraphQL-Java lib with errors that both implement GraphQLError and extend GraphQLException (one example is the above-mentioned NonNullableValueCoercedAsNullException). This is causing the exception because in the GraphQLResponse.from method there is a serialization deserialization cycle using ConfigurableJackson which by default seralize Throwables as String (link) and that String cannot be deserialized back to a Map.
I found some workarounds to prevent this issue (configuring a custom JSON marshaller; not using GraphQLResponse.from; or using ExecutionResult::toSpecification based on graphql-java's documentation) but maybe there are some better solutions for it you are aware of or a bugfix is necessary.
Versions:
http4k: 4.33.1.0
graphql-java: 19.2
The text was updated successfully, but these errors were encountered:
Hi,
we are using http4k with the
GraphQL-java
library and experience some malfunction while transformingExecutionResult
toGraphQLResponse
usingGraphQLResponse.from
. The exception reads as this:Looking into the issue, it seems that
ExecutionResult
can be populated by theGraphQL-Java
lib with errors that both implementGraphQLError
and extendGraphQLException
(one example is the above-mentionedNonNullableValueCoercedAsNullException
). This is causing the exception because in theGraphQLResponse.from
method there is a serialization deserialization cycle usingConfigurableJackson
which by default seralizeThrowable
s as String (link) and that String cannot be deserialized back to aMap
.I found some workarounds to prevent this issue (configuring a custom JSON marshaller; not using
GraphQLResponse.from
; or usingExecutionResult::toSpecification
based on graphql-java's documentation) but maybe there are some better solutions for it you are aware of or a bugfix is necessary.Versions:
http4k: 4.33.1.0
graphql-java: 19.2
The text was updated successfully, but these errors were encountered: