This repository was archived by the owner on Dec 19, 2023. It is now read-only.
Repository navigation
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello!
I use the graphql-spring-boot-starter in webflux environment.
Suppose, i use the following configuration with graphql.tools.use-default-object-mapper=false :
` @bean
@primary
public ObjectMapper objectMapper() {
final var objectMapper = new ObjectMapper();
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
objectMapper.registerModule(new JavaTimeModule());
objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd"));
return objectMapper;
}
@configuration
@requiredargsconstructor
public class WebFluxConfig extends WebFluxConfigurationSupport {
private final ObjectMapper defaultObjectMapper;
}
@configuration
@requiredargsconstructor
public class GraphQlConfig {
@bean
public GraphQLObjectMapper graphQLObjectMapper() {
return GraphQLObjectMapper.newBuilder()
.withObjectMapperProvider(ObjectMapper::new)
.withObjectMapperConfigurer(objectMapper -> objectMapper.setSerializationInclusion(
JsonInclude.Include.NON_NULL))
.build();
}
}`
graphql-java-kickstart uses the primary object mapper, used in WebFluxConfig class.
how i can force to use the GraphQLObjectMapper or settings in objectMapperConfigurer() ?
All reactions