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

Commit cbcb371

Browse files
authored
Merge pull request #202 from graphql-java-kickstart/feature/batch-handler-update
Updated batch execution handling
2 parents 6c42392 + 62f4e55 commit cbcb371

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1818
#
1919

20-
version = 5.6.0
20+
version = 5.6.1
2121
PROJECT_GROUP = com.graphql-java-kickstart
2222
PROJECT_NAME = graphql-spring-boot
2323
PROJECT_DESC = GraphQL Spring Framework Boot
@@ -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.3.0
43+
LIB_GRAPHQL_SERVLET_VER = 7.3.2
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: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
import graphql.execution.preparsed.PreparsedDocumentProvider;
3232
import graphql.schema.GraphQLSchema;
3333
import graphql.servlet.AbstractGraphQLHttpServlet;
34+
import graphql.servlet.BatchExecutionHandler;
3435
import graphql.servlet.DefaultExecutionStrategyProvider;
3536
import graphql.servlet.DefaultGraphQLSchemaProvider;
3637
import graphql.servlet.ExecutionStrategyProvider;
37-
import graphql.servlet.GraphQLBatchExecutionHandlerFactory;
3838
import graphql.servlet.GraphQLConfiguration;
3939
import graphql.servlet.GraphQLContextBuilder;
4040
import graphql.servlet.GraphQLErrorHandler;
@@ -128,7 +128,7 @@ public class GraphQLWebAutoConfiguration implements ApplicationContextAware {
128128
private MultipartConfigElement multipartConfigElement;
129129

130130
@Autowired(required = false)
131-
private GraphQLBatchExecutionHandlerFactory graphQLBatchExecutionHandlerFactory;
131+
private BatchExecutionHandler batchExecutionHandler;
132132

133133
@Override
134134
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
@@ -223,6 +223,10 @@ public GraphQLQueryInvoker queryInvoker(ExecutionStrategyProvider executionStrat
223223
builder.withPreparsedDocumentProvider(preparsedDocumentProvider);
224224
}
225225

226+
if (batchExecutionHandler != null) {
227+
builder.withBatchExeuctionHandler(batchExecutionHandler);
228+
}
229+
226230
return builder.build();
227231
}
228232

@@ -257,14 +261,13 @@ public ObjectMapperProvider objectMapperProvider(ObjectMapper objectMapper) {
257261

258262
@Bean
259263
@ConditionalOnMissingBean
260-
public GraphQLConfiguration graphQLConfiguration(GraphQLInvocationInputFactory invocationInputFactory, GraphQLQueryInvoker queryInvoker, GraphQLObjectMapper graphQLObjectMapper) {
264+
public GraphQLConfiguration graphQLServletConfiguration(GraphQLInvocationInputFactory invocationInputFactory, GraphQLQueryInvoker queryInvoker, GraphQLObjectMapper graphQLObjectMapper) {
261265
return GraphQLConfiguration.with(invocationInputFactory)
262266
.with(queryInvoker)
263267
.with(graphQLObjectMapper)
264268
.with(listeners)
265269
.with(graphQLServletProperties.isAsyncModeEnabled())
266270
.with(graphQLServletProperties.getSubscriptionTimeout())
267-
.with(graphQLBatchExecutionHandlerFactory)
268271
.build();
269272
}
270273

0 commit comments

Comments
 (0)