Class JacksonGraphQLJsonSerializer
java.lang.Object
io.micronaut.configuration.graphql.JacksonGraphQLJsonSerializer
- All Implemented Interfaces:
GraphQLJsonSerializer
@Singleton
public class JacksonGraphQLJsonSerializer
extends Object
implements GraphQLJsonSerializer
The Jackson implementation for serializing and deserializing GraphQL objects.
- Since:
- 1.0
- Author:
- Marcel Overdijk
-
Constructor Summary
ConstructorDescriptionJacksonGraphQLJsonSerializer
(io.micronaut.json.JsonMapper jsonMapper) Default constructor. -
Method Summary
-
Constructor Details
-
JacksonGraphQLJsonSerializer
public JacksonGraphQLJsonSerializer(io.micronaut.json.JsonMapper jsonMapper) Default constructor.- Parameters:
jsonMapper
- theJsonMapper
instance- Since:
- 3.1.0
-
-
Method Details
-
serialize
Serializes the given object to a jsonString
.- Specified by:
serialize
in interfaceGraphQLJsonSerializer
- Parameters:
object
- the object to serialize- Returns:
- the json string
-
deserialize
Deserializes the given jsonString
to an object of the required type.- Specified by:
deserialize
in interfaceGraphQLJsonSerializer
- Type Parameters:
T
- the required generic type- Parameters:
json
- the json stringrequiredType
- the required type- Returns:
- the object
-