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 an object containing an Instant is sent over the subscription as a non-scalar (List), the Instant is converted to a string by graphql prior to jackson, and is able to be serialized by ApolloMessages within the jsonMessage method.
When the object is sent over the subscription as a scalar (Map_String_ObjectWithInstant), the Instant retains its data type up to jackson, and since the object mapper in ApolloMessages does not have the JavaTimeModule registered, it can no longer be serialized and produces the following exception:
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Java 8 date/time type java.time.Instant not supported by default: add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling
Originating from AplloMessages:71
I resolved the issue by creating my own PerConnectionApolloHandler bean, and providing duplicate implementations of PerConnectionApolloHandler, ApolloProtocolHandler, and finally ApolloMessages with the updated object mapper.
Do we have a better way to solve this?
The text was updated successfully, but these errors were encountered:
When an object containing an Instant is sent over the subscription as a non-scalar (List), the Instant is converted to a string by graphql prior to jackson, and is able to be serialized by ApolloMessages within the jsonMessage method.
When the object is sent over the subscription as a scalar (Map_String_ObjectWithInstant), the Instant retains its data type up to jackson, and since the object mapper in ApolloMessages does not have the JavaTimeModule registered, it can no longer be serialized and produces the following exception:
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Java 8 date/time type
java.time.Instantnot supported by default: add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling
Originating from AplloMessages:71
I resolved the issue by creating my own PerConnectionApolloHandler bean, and providing duplicate implementations of PerConnectionApolloHandler, ApolloProtocolHandler, and finally ApolloMessages with the updated object mapper.
Do we have a better way to solve this?
The text was updated successfully, but these errors were encountered: