Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Commit 31f5195

Browse files
authored
Merge pull request #196 from jmccaull/update_servlet_7.3.0
update graphql servlet dependency
2 parents ed36772 + b3d4120 commit 31f5195

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ LIB_GRAPHQL_JAVA_VER = 11.0
4040
LIB_JUNIT_VER = 4.12
4141
LIB_SPRING_CORE_VER = 5.0.4.RELEASE
4242
LIB_SPRING_BOOT_VER = 2.1.3.RELEASE
43-
LIB_GRAPHQL_SERVLET_VER = 7.2.0
43+
LIB_GRAPHQL_SERVLET_VER = 7.3.0
4444
LIB_GRAPHQL_JAVA_TOOLS_VER = 5.5.0
4545
LIB_COMMONS_IO_VER = 2.6
4646
kotlin.version=1.3.10

graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLWebAutoConfiguration.java

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import graphql.servlet.DefaultExecutionStrategyProvider;
3535
import graphql.servlet.DefaultGraphQLSchemaProvider;
3636
import graphql.servlet.ExecutionStrategyProvider;
37+
import graphql.servlet.GraphQLBatchExecutionHandlerFactory;
3738
import graphql.servlet.GraphQLConfiguration;
3839
import graphql.servlet.GraphQLContextBuilder;
3940
import graphql.servlet.GraphQLErrorHandler;
@@ -126,6 +127,9 @@ public class GraphQLWebAutoConfiguration implements ApplicationContextAware {
126127
@Autowired(required = false)
127128
private MultipartConfigElement multipartConfigElement;
128129

130+
@Autowired(required = false)
131+
private GraphQLBatchExecutionHandlerFactory graphQLBatchExecutionHandlerFactory;
132+
129133
@Override
130134
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
131135
if (errorHandler == null) {
@@ -251,18 +255,23 @@ public ObjectMapperProvider objectMapperProvider(ObjectMapper objectMapper) {
251255
return () -> objectMapper;
252256
}
253257

258+
@Bean
259+
@ConditionalOnMissingBean
260+
public GraphQLConfiguration graphQLConfiguration(GraphQLInvocationInputFactory invocationInputFactory, GraphQLQueryInvoker queryInvoker, GraphQLObjectMapper graphQLObjectMapper) {
261+
return GraphQLConfiguration.with(invocationInputFactory)
262+
.with(queryInvoker)
263+
.with(graphQLObjectMapper)
264+
.with(listeners)
265+
.with(graphQLServletProperties.isAsyncModeEnabled())
266+
.with(graphQLServletProperties.getSubscriptionTimeout())
267+
.with(graphQLBatchExecutionHandlerFactory)
268+
.build();
269+
}
254270

255271
@Bean
256272
@ConditionalOnMissingBean
257-
public GraphQLHttpServlet graphQLHttpServlet(GraphQLInvocationInputFactory invocationInputFactory, GraphQLQueryInvoker queryInvoker, GraphQLObjectMapper graphQLObjectMapper) {
258-
GraphQLConfiguration configuration = GraphQLConfiguration.with(invocationInputFactory)
259-
.with(queryInvoker)
260-
.with(graphQLObjectMapper)
261-
.with(listeners)
262-
.with(graphQLServletProperties.isAsyncModeEnabled())
263-
.with(graphQLServletProperties.getSubscriptionTimeout())
264-
.build();
265-
return GraphQLHttpServlet.with(configuration);
273+
public GraphQLHttpServlet graphQLHttpServlet(GraphQLConfiguration graphQLConfiguration) {
274+
return GraphQLHttpServlet.with(graphQLConfiguration);
266275
}
267276

268277
@Bean

0 commit comments

Comments
 (0)