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
{{ message }}
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.
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;
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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() ?
Beta Was this translation helpful? Give feedback.
All reactions