11package graphql .kickstart .tools .boot ;
22
3+ import com .fasterxml .jackson .databind .ObjectMapper ;
4+ import com .fasterxml .jackson .datatype .jdk8 .Jdk8Module ;
5+ import com .fasterxml .jackson .module .kotlin .KotlinModule ;
6+ import graphql .kickstart .tools .CoroutineContextProvider ;
37import graphql .kickstart .tools .GraphQLResolver ;
8+ import graphql .kickstart .tools .ObjectMapperConfigurer ;
49import graphql .kickstart .tools .PerFieldObjectMapperProvider ;
10+ import graphql .kickstart .tools .ProxyHandler ;
511import graphql .kickstart .tools .SchemaParser ;
612import graphql .kickstart .tools .SchemaParserBuilder ;
713import graphql .kickstart .tools .SchemaParserDictionary ;
814import graphql .kickstart .tools .SchemaParserOptions ;
15+ import graphql .kickstart .tools .SchemaParserOptions .GenericWrapper ;
916import graphql .kickstart .tools .TypeDefinitionFactory ;
10- import com .fasterxml .jackson .databind .ObjectMapper ;
11- import com .fasterxml .jackson .datatype .jdk8 .Jdk8Module ;
12- import com .fasterxml .jackson .module .kotlin .KotlinModule ;
1317import graphql .kickstart .execution .config .GraphQLSchemaProvider ;
1418import graphql .schema .GraphQLScalarType ;
1519import graphql .schema .GraphQLSchema ;
1620import graphql .schema .idl .SchemaDirectiveWiring ;
1721import java .io .IOException ;
1822import java .util .List ;
23+
24+ import kotlin .coroutines .CoroutineContext ;
1925import lombok .extern .slf4j .Slf4j ;
2026import org .springframework .beans .factory .annotation .Autowired ;
2127import org .springframework .boot .autoconfigure .AutoConfigureAfter ;
@@ -51,6 +57,18 @@ public class GraphQLJavaToolsAutoConfiguration {
5157 @ Autowired (required = false )
5258 private List <SchemaDirectiveWiring > directiveWirings ;
5359
60+ @ Autowired (required = false )
61+ private List <GenericWrapper > genericWrappers ;
62+
63+ @ Autowired (required = false )
64+ private ObjectMapperConfigurer objectMapperConfigurer ;
65+
66+ @ Autowired (required = false )
67+ private List <ProxyHandler > proxyHandlers ;
68+
69+ @ Autowired (required = false )
70+ private CoroutineContextProvider coroutineContextProvider ;
71+
5472 @ Autowired (required = false )
5573 private List <TypeDefinitionFactory > typeDefinitionFactories ;
5674
@@ -73,9 +91,24 @@ public SchemaParserOptions.Builder optionsBuilder(
7391
7492 if (perFieldObjectMapperProvider != null ) {
7593 optionsBuilder .objectMapperProvider (perFieldObjectMapperProvider );
94+ } else {
95+ optionsBuilder .objectMapperConfigurer (objectMapperConfigurer );
7696 }
97+
7798 optionsBuilder .introspectionEnabled (props .isIntrospectionEnabled ());
7899
100+ if (genericWrappers != null ) {
101+ optionsBuilder .genericWrappers (genericWrappers );
102+ }
103+
104+ if (proxyHandlers != null ) {
105+ proxyHandlers .forEach (optionsBuilder ::addProxyHandler );
106+ }
107+
108+ if (coroutineContextProvider != null ) {
109+ optionsBuilder .coroutineContextProvider (coroutineContextProvider );
110+ }
111+
79112 if (typeDefinitionFactories != null ) {
80113 typeDefinitionFactories .forEach (optionsBuilder ::typeDefinitionFactory );
81114 }
0 commit comments