diff --git a/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/WebFluxGraphQLAutoConfiguration.java b/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/WebFluxGraphQLAutoConfiguration.java index 06bf41d6..e1abb719 100644 --- a/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/WebFluxGraphQLAutoConfiguration.java +++ b/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/WebFluxGraphQLAutoConfiguration.java @@ -34,11 +34,9 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoader; -import org.springframework.graphql.DefaultWebGraphQLRequestHandler; -import org.springframework.graphql.GraphQLRequestHandler; -import org.springframework.graphql.WebInput; +import org.springframework.graphql.DefaultWebGraphQLService; +import org.springframework.graphql.WebGraphQLService; import org.springframework.graphql.WebInterceptor; -import org.springframework.graphql.WebOutput; import org.springframework.graphql.webflux.GraphQLHttpHandler; import org.springframework.graphql.webflux.GraphQLWebSocketHandler; import org.springframework.http.MediaType; @@ -65,18 +63,16 @@ public class WebFluxGraphQLAutoConfiguration { @Bean @ConditionalOnMissingBean - public GraphQLRequestHandler graphQLRequestHandler( - GraphQL graphQL, ObjectProvider interceptors) { - - DefaultWebGraphQLRequestHandler handler = new DefaultWebGraphQLRequestHandler(graphQL); + public WebGraphQLService webGraphQLService(GraphQL graphQL, ObjectProvider interceptors) { + DefaultWebGraphQLService handler = new DefaultWebGraphQLService(graphQL); handler.setInterceptors(interceptors.orderedStream().collect(Collectors.toList())); return handler; } @Bean @ConditionalOnMissingBean - public GraphQLHttpHandler graphQLHandler(GraphQLRequestHandler requestHandler) { - return new GraphQLHttpHandler(requestHandler); + public GraphQLHttpHandler graphQLHandler(WebGraphQLService service) { + return new GraphQLHttpHandler(service); } @Bean @@ -102,11 +98,10 @@ public class WebFluxGraphQLAutoConfiguration { @Bean @ConditionalOnMissingBean public GraphQLWebSocketHandler graphQLWebSocketHandler( - GraphQLRequestHandler handler, GraphQLProperties properties, - ServerCodecConfigurer configurer) { + WebGraphQLService service, GraphQLProperties properties, ServerCodecConfigurer configurer) { return new GraphQLWebSocketHandler( - handler, configurer, properties.getWebsocket().getConnectionInitTimeout()); + service, configurer, properties.getWebsocket().getConnectionInitTimeout()); } @Bean diff --git a/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/WebMvcGraphQLAutoConfiguration.java b/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/WebMvcGraphQLAutoConfiguration.java index 64680199..8172ef78 100644 --- a/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/WebMvcGraphQLAutoConfiguration.java +++ b/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/WebMvcGraphQLAutoConfiguration.java @@ -38,11 +38,9 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoader; -import org.springframework.graphql.DefaultWebGraphQLRequestHandler; -import org.springframework.graphql.GraphQLRequestHandler; -import org.springframework.graphql.WebInput; +import org.springframework.graphql.DefaultWebGraphQLService; +import org.springframework.graphql.WebGraphQLService; import org.springframework.graphql.WebInterceptor; -import org.springframework.graphql.WebOutput; import org.springframework.graphql.webmvc.GraphQLHttpHandler; import org.springframework.graphql.webmvc.GraphQLWebSocketHandler; import org.springframework.http.HttpHeaders; @@ -72,18 +70,16 @@ public class WebMvcGraphQLAutoConfiguration { @Bean @ConditionalOnMissingBean - public GraphQLRequestHandler graphQLRequestHandler( - GraphQL graphQL, ObjectProvider interceptors) { - - DefaultWebGraphQLRequestHandler handler = new DefaultWebGraphQLRequestHandler(graphQL); + public WebGraphQLService webGraphQLService(GraphQL graphQL, ObjectProvider interceptors) { + DefaultWebGraphQLService handler = new DefaultWebGraphQLService(graphQL); handler.setInterceptors(interceptors.orderedStream().collect(Collectors.toList())); return handler; } @Bean @ConditionalOnMissingBean - public GraphQLHttpHandler graphQLHandler(GraphQLRequestHandler requestHandler) { - return new GraphQLHttpHandler(requestHandler); + public GraphQLHttpHandler graphQLHandler(WebGraphQLService service) { + return new GraphQLHttpHandler(service); } @Bean @@ -111,8 +107,7 @@ public class WebMvcGraphQLAutoConfiguration { @Bean @ConditionalOnMissingBean public GraphQLWebSocketHandler graphQLWebSocketHandler( - GraphQLRequestHandler handler, GraphQLProperties properties, - HttpMessageConverters converters) { + WebGraphQLService service, GraphQLProperties properties, HttpMessageConverters converters) { HttpMessageConverter converter = converters.getConverters().stream() .filter(candidate -> candidate.canRead(Map.class, MediaType.APPLICATION_JSON)) @@ -120,7 +115,7 @@ public class WebMvcGraphQLAutoConfiguration { .orElseThrow(() -> new IllegalStateException("No JSON converter")); return new GraphQLWebSocketHandler( - handler, converter, properties.getWebsocket().getConnectionInitTimeout()); + service, converter, properties.getWebsocket().getConnectionInitTimeout()); } @Bean diff --git a/spring-graphql-web/src/main/java/org/springframework/graphql/AbstractWebGraphQLRequestHandler.java b/spring-graphql-web/src/main/java/org/springframework/graphql/AbstractWebGraphQLService.java similarity index 79% rename from spring-graphql-web/src/main/java/org/springframework/graphql/AbstractWebGraphQLRequestHandler.java rename to spring-graphql-web/src/main/java/org/springframework/graphql/AbstractWebGraphQLService.java index f452f4d3..08e3c392 100644 --- a/spring-graphql-web/src/main/java/org/springframework/graphql/AbstractWebGraphQLRequestHandler.java +++ b/spring-graphql-web/src/main/java/org/springframework/graphql/AbstractWebGraphQLService.java @@ -24,12 +24,12 @@ import graphql.ExecutionResult; import reactor.core.publisher.Mono; /** - * Base class for {@link GraphQLRequestHandler} implementations that supports - * customizations of request handling through a {@link WebInterceptor} chain. - * Sub-classes must implement {@link #handleInternal(ExecutionInput)} for the - * actual handling of the GraphQL query. + * Base class for {@link WebGraphQLService} implementations, providing support + * for customizations of the request through a {@link WebInterceptor} chain. + * Sub-classes must implement {@link #executeInternal(ExecutionInput)} to + * actually perform the GraphQL query. */ -public abstract class AbstractWebGraphQLRequestHandler implements GraphQLRequestHandler { +public abstract class AbstractWebGraphQLService implements WebGraphQLService { private final List interceptors = new ArrayList<>(); @@ -52,9 +52,9 @@ public abstract class AbstractWebGraphQLRequestHandler implements GraphQLRequest @Override - public final Mono handle(WebInput input) { + public final Mono execute(WebInput input) { return preHandle(input) - .flatMap(executionInput -> Mono.fromFuture(handleInternal(executionInput))) + .flatMap(executionInput -> Mono.fromFuture(executeInternal(executionInput))) .flatMap(executionResult -> postHandle(new WebOutput(input, executionResult, null))); } @@ -80,6 +80,6 @@ public abstract class AbstractWebGraphQLRequestHandler implements GraphQLRequest * @param input the input to invoke {@link graphql.GraphQL} with * @return the result from handling */ - protected abstract CompletableFuture handleInternal(ExecutionInput input); + protected abstract CompletableFuture executeInternal(ExecutionInput input); } diff --git a/spring-graphql-web/src/main/java/org/springframework/graphql/DefaultWebGraphQLRequestHandler.java b/spring-graphql-web/src/main/java/org/springframework/graphql/DefaultWebGraphQLService.java similarity index 72% rename from spring-graphql-web/src/main/java/org/springframework/graphql/DefaultWebGraphQLRequestHandler.java rename to spring-graphql-web/src/main/java/org/springframework/graphql/DefaultWebGraphQLService.java index 49871d7e..4fd5cc4d 100644 --- a/spring-graphql-web/src/main/java/org/springframework/graphql/DefaultWebGraphQLRequestHandler.java +++ b/spring-graphql-web/src/main/java/org/springframework/graphql/DefaultWebGraphQLService.java @@ -22,21 +22,21 @@ import graphql.ExecutionResult; import graphql.GraphQL; /** - * Extension of {@link AbstractWebGraphQLRequestHandler} that simply delegates - * to {@link GraphQL}to execute the request. + * Extension of {@link AbstractWebGraphQLService} that executes GraphQL queries + * through the {@link GraphQL} instance it is configured with. */ -public class DefaultWebGraphQLRequestHandler extends AbstractWebGraphQLRequestHandler { +public class DefaultWebGraphQLService extends AbstractWebGraphQLService { private final GraphQL graphQL; - public DefaultWebGraphQLRequestHandler(GraphQL graphQL) { + public DefaultWebGraphQLService(GraphQL graphQL) { this.graphQL = graphQL; } @Override - protected CompletableFuture handleInternal(ExecutionInput input) { + protected CompletableFuture executeInternal(ExecutionInput input) { return this.graphQL.executeAsync(input); } diff --git a/spring-graphql-web/src/main/java/org/springframework/graphql/GraphQLRequestHandler.java b/spring-graphql-web/src/main/java/org/springframework/graphql/GraphQLService.java similarity index 66% rename from spring-graphql-web/src/main/java/org/springframework/graphql/GraphQLRequestHandler.java rename to spring-graphql-web/src/main/java/org/springframework/graphql/GraphQLService.java index 339dae7d..07a5373d 100644 --- a/spring-graphql-web/src/main/java/org/springframework/graphql/GraphQLRequestHandler.java +++ b/spring-graphql-web/src/main/java/org/springframework/graphql/GraphQLService.java @@ -19,16 +19,19 @@ import graphql.ExecutionResult; import reactor.core.publisher.Mono; /** - * Contract to handle a GraphQL request. + * Contract to execute a GraphQL request. + * + * @param the GraphQL query container along with any additional context + * depending on the environment in which the request is handled + * @param the result of query execution and additional environment output */ -@FunctionalInterface -public interface GraphQLRequestHandler { +public interface GraphQLService { /** - * Handle the request and return the result of execution. + * Perform the request and return the result. * @param input the GraphQL query container * @return the execution result */ - Mono handle(I input); + Mono execute(I input); } diff --git a/spring-graphql-web/src/main/java/org/springframework/graphql/WebGraphQLService.java b/spring-graphql-web/src/main/java/org/springframework/graphql/WebGraphQLService.java new file mode 100644 index 00000000..94e64404 --- /dev/null +++ b/spring-graphql-web/src/main/java/org/springframework/graphql/WebGraphQLService.java @@ -0,0 +1,24 @@ +/* + * Copyright 2002-2021 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.graphql; + +/** + * {@link GraphQLService} for executing GraphQL requests in a Web environment, + * over HTTP or WebSocket. + */ +public interface WebGraphQLService extends GraphQLService { + +} diff --git a/spring-graphql-web/src/main/java/org/springframework/graphql/webflux/GraphQLHttpHandler.java b/spring-graphql-web/src/main/java/org/springframework/graphql/webflux/GraphQLHttpHandler.java index fde5a2eb..54dc52e9 100644 --- a/spring-graphql-web/src/main/java/org/springframework/graphql/webflux/GraphQLHttpHandler.java +++ b/spring-graphql-web/src/main/java/org/springframework/graphql/webflux/GraphQLHttpHandler.java @@ -22,9 +22,8 @@ import org.apache.commons.logging.LogFactory; import reactor.core.publisher.Mono; import org.springframework.core.ParameterizedTypeReference; -import org.springframework.graphql.GraphQLRequestHandler; +import org.springframework.graphql.WebGraphQLService; import org.springframework.graphql.WebInput; -import org.springframework.graphql.WebOutput; import org.springframework.util.Assert; import org.springframework.web.reactive.function.server.ServerRequest; import org.springframework.web.reactive.function.server.ServerResponse; @@ -40,16 +39,16 @@ public class GraphQLHttpHandler { new ParameterizedTypeReference>() {}; - private final GraphQLRequestHandler requestHandler; + private final WebGraphQLService graphQLService; /** * Create a new instance. - * @param requestHandler the handler to use for GraphQL query handling + * @param service for GraphQL query execution */ - public GraphQLHttpHandler(GraphQLRequestHandler requestHandler) { - Assert.notNull(requestHandler, "GraphQLRequestHandler is required"); - this.requestHandler = requestHandler; + public GraphQLHttpHandler(WebGraphQLService service) { + Assert.notNull(service, "WebGraphQLService is required"); + this.graphQLService = service; } @@ -63,7 +62,7 @@ public class GraphQLHttpHandler { if (logger.isDebugEnabled()) { logger.debug("Executing: " + webInput); } - return this.requestHandler.handle(webInput); + return this.graphQLService.execute(webInput); }) .flatMap(output -> { Map spec = output.toSpecification(); diff --git a/spring-graphql-web/src/main/java/org/springframework/graphql/webflux/GraphQLWebSocketHandler.java b/spring-graphql-web/src/main/java/org/springframework/graphql/webflux/GraphQLWebSocketHandler.java index edfb8857..f7b3047e 100644 --- a/spring-graphql-web/src/main/java/org/springframework/graphql/webflux/GraphQLWebSocketHandler.java +++ b/spring-graphql-web/src/main/java/org/springframework/graphql/webflux/GraphQLWebSocketHandler.java @@ -39,8 +39,7 @@ import org.springframework.core.codec.Decoder; import org.springframework.core.codec.Encoder; import org.springframework.core.io.buffer.DataBuffer; import org.springframework.core.io.buffer.DataBufferUtils; -import org.springframework.graphql.GraphQLRequestHandler; -import org.springframework.graphql.WebInput; +import org.springframework.graphql.WebGraphQLService; import org.springframework.graphql.WebOutput; import org.springframework.graphql.WebSocketMessageInput; import org.springframework.http.MediaType; @@ -73,7 +72,7 @@ public class GraphQLWebSocketHandler implements WebSocketHandler { ResolvableType.forType(new ParameterizedTypeReference>() {}); - private final GraphQLRequestHandler requestHandler; + private final WebGraphQLService graphQLService; private final Decoder decoder; @@ -84,16 +83,16 @@ public class GraphQLWebSocketHandler implements WebSocketHandler { /** * Create a new instance. - * @param requestHandler the handler to use for GraphQL query handling + * @param service for GraphQL query execution * @param configurer codec configurer for JSON encoding and decoding * @param connectionInitTimeout the time within which the {@code CONNECTION_INIT} * type message must be received. */ - public GraphQLWebSocketHandler(GraphQLRequestHandler requestHandler, - ServerCodecConfigurer configurer, Duration connectionInitTimeout) { + public GraphQLWebSocketHandler( + WebGraphQLService service, ServerCodecConfigurer configurer, Duration connectionInitTimeout) { - Assert.notNull(requestHandler, "GraphQLRequestHandler is required"); - this.requestHandler = requestHandler; + Assert.notNull(service, "WebGraphQLService is required"); + this.graphQLService = service; this.decoder = initDecoder(configurer); this.encoder = initEncoder(configurer); this.initTimeoutDuration = connectionInitTimeout; @@ -165,7 +164,7 @@ public class GraphQLWebSocketHandler implements WebSocketHandler { if (logger.isDebugEnabled()) { logger.debug("Executing: " + input); } - return this.requestHandler.handle(input) + return this.graphQLService.execute(input) .flatMapMany(output -> handleWebOutput(session, id, subscriptions, output)) .doOnTerminate(() -> subscriptions.remove(id)); case COMPLETE: diff --git a/spring-graphql-web/src/main/java/org/springframework/graphql/webmvc/GraphQLHttpHandler.java b/spring-graphql-web/src/main/java/org/springframework/graphql/webmvc/GraphQLHttpHandler.java index 0c4be48b..b361cb56 100644 --- a/spring-graphql-web/src/main/java/org/springframework/graphql/webmvc/GraphQLHttpHandler.java +++ b/spring-graphql-web/src/main/java/org/springframework/graphql/webmvc/GraphQLHttpHandler.java @@ -25,9 +25,8 @@ import org.apache.commons.logging.LogFactory; import reactor.core.publisher.Mono; import org.springframework.core.ParameterizedTypeReference; -import org.springframework.graphql.GraphQLRequestHandler; +import org.springframework.graphql.WebGraphQLService; import org.springframework.graphql.WebInput; -import org.springframework.graphql.WebOutput; import org.springframework.util.Assert; import org.springframework.web.HttpMediaTypeNotSupportedException; import org.springframework.web.server.ServerWebInputException; @@ -46,16 +45,16 @@ public class GraphQLHttpHandler { new ParameterizedTypeReference>() {}; - private final GraphQLRequestHandler requestHandler; + private final WebGraphQLService graphQLService; /** * Create a new instance. - * @param requestHandler the handler to use for GraphQL query handling + * @param service for GraphQL query execution */ - public GraphQLHttpHandler(GraphQLRequestHandler requestHandler) { - Assert.notNull(requestHandler, "GraphQLRequestHandler is required"); - this.requestHandler = requestHandler; + public GraphQLHttpHandler(WebGraphQLService service) { + Assert.notNull(service, "WebGraphQLService is required"); + this.graphQLService = service; } @@ -70,7 +69,7 @@ public class GraphQLHttpHandler { if (logger.isDebugEnabled()) { logger.debug("Executing: " + webInput); } - Mono responseMono = this.requestHandler.handle(webInput) + Mono responseMono = this.graphQLService.execute(webInput) .map(output -> { if (logger.isDebugEnabled()) { logger.debug("Execution complete"); diff --git a/spring-graphql-web/src/main/java/org/springframework/graphql/webmvc/GraphQLWebSocketHandler.java b/spring-graphql-web/src/main/java/org/springframework/graphql/webmvc/GraphQLWebSocketHandler.java index d20a74df..aa192579 100644 --- a/spring-graphql-web/src/main/java/org/springframework/graphql/webmvc/GraphQLWebSocketHandler.java +++ b/spring-graphql-web/src/main/java/org/springframework/graphql/webmvc/GraphQLWebSocketHandler.java @@ -41,8 +41,7 @@ import reactor.core.publisher.Mono; import reactor.core.scheduler.Scheduler; import reactor.core.scheduler.Schedulers; -import org.springframework.graphql.GraphQLRequestHandler; -import org.springframework.graphql.WebInput; +import org.springframework.graphql.WebGraphQLService; import org.springframework.graphql.WebOutput; import org.springframework.graphql.WebSocketMessageInput; import org.springframework.http.HttpHeaders; @@ -72,7 +71,7 @@ public class GraphQLWebSocketHandler extends TextWebSocketHandler implements Sub Arrays.asList("graphql-transport-ws", "subscriptions-transport-ws"); - private final GraphQLRequestHandler requestHandler; + private final WebGraphQLService service; private final Duration initTimeoutDuration; @@ -83,17 +82,17 @@ public class GraphQLWebSocketHandler extends TextWebSocketHandler implements Sub /** * Create a new instance. - * @param requestHandler the handler to use for GraphQL query handling + * @param service for GraphQL query execution * @param converter for JSON encoding and decoding * @param connectionInitTimeout the time within which the {@code CONNECTION_INIT} * type message must be received. */ public GraphQLWebSocketHandler( - GraphQLRequestHandler requestHandler, HttpMessageConverter converter, - Duration connectionInitTimeout) { + WebGraphQLService service, HttpMessageConverter converter, Duration connectionInitTimeout) { + Assert.notNull(service, "WebGraphQLService is required"); Assert.notNull(converter, "HttpMessageConverter for JSON is required"); - this.requestHandler = requestHandler; + this.service = service; this.initTimeoutDuration = connectionInitTimeout; this.converter = converter; } @@ -155,7 +154,7 @@ public class GraphQLWebSocketHandler extends TextWebSocketHandler implements Sub if (logger.isDebugEnabled()) { logger.debug("Executing: " + input); } - this.requestHandler.handle(input) + this.service.execute(input) .flatMapMany(output -> handleWebOutput(session, input.requestId(), output)) .publishOn(sessionState.getScheduler()) // Serial blocking send via single thread .subscribe(new SendMessageSubscriber(id, session, sessionState)); diff --git a/spring-graphql-web/src/test/java/org/springframework/graphql/DefaultWebGraphQLRequestHandlerTests.java b/spring-graphql-web/src/test/java/org/springframework/graphql/DefaultWebGraphQLServiceTests.java similarity index 92% rename from spring-graphql-web/src/test/java/org/springframework/graphql/DefaultWebGraphQLRequestHandlerTests.java rename to spring-graphql-web/src/test/java/org/springframework/graphql/DefaultWebGraphQLServiceTests.java index a17e1cbe..44638713 100644 --- a/spring-graphql-web/src/test/java/org/springframework/graphql/DefaultWebGraphQLRequestHandlerTests.java +++ b/spring-graphql-web/src/test/java/org/springframework/graphql/DefaultWebGraphQLServiceTests.java @@ -40,9 +40,9 @@ import static graphql.schema.idl.TypeRuntimeWiring.newTypeWiring; import static org.assertj.core.api.Assertions.assertThat; /** - * Unit tests for {@link DefaultWebGraphQLRequestHandler}. + * Unit tests for {@link DefaultWebGraphQLService}. */ -public class DefaultWebGraphQLRequestHandlerTests { +public class DefaultWebGraphQLServiceTests { @Test void testInterceptorInvocation() throws Exception { @@ -64,10 +64,10 @@ public class DefaultWebGraphQLRequestHandlerTests { Map body = mapper.reader().readValue("{\"query\": \"" + query + "\"}", Map.class); WebInput webInput = new WebInput(URI.create("/graphql"), new HttpHeaders(), body); - DefaultWebGraphQLRequestHandler requestHandler = new DefaultWebGraphQLRequestHandler(createGraphQL()); + DefaultWebGraphQLService requestHandler = new DefaultWebGraphQLService(createGraphQL()); requestHandler.setInterceptors(interceptors); - WebOutput webOutput = requestHandler.handle(webInput).block(); + WebOutput webOutput = requestHandler.execute(webInput).block(); assertThat(sb.toString()).isEqualTo(":pre1:pre2:pre3:post3:post2:post1"); assertThat(webOutput.isDataPresent()).isTrue(); diff --git a/spring-graphql-web/src/test/java/org/springframework/graphql/webflux/GraphQLWebSocketHandlerTests.java b/spring-graphql-web/src/test/java/org/springframework/graphql/webflux/GraphQLWebSocketHandlerTests.java index 03edc449..57ef9488 100644 --- a/spring-graphql-web/src/test/java/org/springframework/graphql/webflux/GraphQLWebSocketHandlerTests.java +++ b/spring-graphql-web/src/test/java/org/springframework/graphql/webflux/GraphQLWebSocketHandlerTests.java @@ -42,7 +42,7 @@ import org.springframework.core.io.buffer.DataBuffer; import org.springframework.core.io.buffer.DataBufferUtils; import org.springframework.core.io.buffer.DefaultDataBufferFactory; import org.springframework.graphql.ConsumeOneAndNeverCompleteInterceptor; -import org.springframework.graphql.DefaultWebGraphQLRequestHandler; +import org.springframework.graphql.DefaultWebGraphQLService; import org.springframework.graphql.GraphQLDataFetchers; import org.springframework.graphql.WebInterceptor; import org.springframework.http.HttpHeaders; @@ -280,7 +280,7 @@ public class GraphQLWebSocketHandlerTests { GraphQL graphQL = initGraphQL(); - DefaultWebGraphQLRequestHandler requestHandler = new DefaultWebGraphQLRequestHandler(graphQL); + DefaultWebGraphQLService requestHandler = new DefaultWebGraphQLService(graphQL); if (interceptors != null) { requestHandler.setInterceptors(interceptors); } diff --git a/spring-graphql-web/src/test/java/org/springframework/graphql/webmvc/GraphQLWebSocketHandlerTests.java b/spring-graphql-web/src/test/java/org/springframework/graphql/webmvc/GraphQLWebSocketHandlerTests.java index 6448b6cd..b318f532 100644 --- a/spring-graphql-web/src/test/java/org/springframework/graphql/webmvc/GraphQLWebSocketHandlerTests.java +++ b/spring-graphql-web/src/test/java/org/springframework/graphql/webmvc/GraphQLWebSocketHandlerTests.java @@ -37,7 +37,7 @@ import org.junit.jupiter.api.Test; import reactor.test.StepVerifier; import org.springframework.graphql.ConsumeOneAndNeverCompleteInterceptor; -import org.springframework.graphql.DefaultWebGraphQLRequestHandler; +import org.springframework.graphql.DefaultWebGraphQLService; import org.springframework.graphql.GraphQLDataFetchers; import org.springframework.graphql.WebInterceptor; import org.springframework.http.HttpHeaders; @@ -264,7 +264,7 @@ public class GraphQLWebSocketHandlerTests { try { GraphQL graphQL = initGraphQL(); - DefaultWebGraphQLRequestHandler requestHandler = new DefaultWebGraphQLRequestHandler(graphQL); + DefaultWebGraphQLService requestHandler = new DefaultWebGraphQLService(graphQL); if (interceptors != null) { requestHandler.setInterceptors(interceptors); }