diff --git a/spring-graphql-docs/src/docs/asciidoc/index.adoc b/spring-graphql-docs/src/docs/asciidoc/index.adoc index 485a8b6c..2d282d7d 100644 --- a/spring-graphql-docs/src/docs/asciidoc/index.adoc +++ b/spring-graphql-docs/src/docs/asciidoc/index.adoc @@ -62,7 +62,7 @@ specification. `GraphQlHttpHandler` can be exposed as an HTTP endpoint by declaring a `RouterFunction` bean and using the `RouterFunctions` from Spring MVC or WebFlux to create the route. The Boot starter does this, see the -{spring-boot-ref-docs}/web.html#web.graphql.web-endpoints[Web Endpoints] section for +{spring-boot-ref-docs}/web.html#web.graphql.transports.http-websocket[Web Endpoints] section for details, or check `GraphQlWebMvcAutoConfiguration` or `GraphQlWebFluxAutoConfiguration` it contains, for the actual config. @@ -103,11 +103,12 @@ The `graphql-ws` project lists a number of https://github.com/enisdenjo/graphql-ws#recipes[recipes] for client use. `GraphQlWebSocketHandler` can be exposed as a WebSocket endpoint by declaring a -`SimpleUrlHandlerMapping` bean and using it to map the handler to a URL path. The Boot -starter has options to enable this, see the -{spring-boot-ref-docs}/web.html#web.graphql.web-endpoints[Web Endpoints] section for -details, or check `GraphQlWebMvcAutoConfiguration` or `GraphQlWebFluxAutoConfiguration` -it contains, for the actual config. +`SimpleUrlHandlerMapping` bean and using it to map the handler to a URL path. By default, +the Boot starter does not expose a GraphQL over WebSocket endpoint, but it's easy to +enable it by adding a property for the endpoint path. Please, see the +{spring-boot-ref-docs}/web.html#web.graphql.transports.http-websocket[Web Endpoints] +section for details, or check the `GraphQlWebMvcAutoConfiguration` or the +`GraphQlWebFluxAutoConfiguration` for the actual Boot starter config. The Spring for GraphQL repository contains a WebFlux {github-main-branch}/samples/webflux-websocket[WebSocket sample] application. @@ -216,7 +217,7 @@ class HeaderInterceptor implements WebGraphQlInterceptor { The `WebGraphQlInterceptor` chain can be updated through the `WebGraphQlHandler` builder, and the Boot starter uses this, see Boot's section on -{spring-boot-ref-docs}/web.html#web.graphql.web-endpoints[Web Endpoints]. +{spring-boot-ref-docs}/web.html#web.graphql.transports.http-websocket[Web Endpoints]. The <> transport handler delegates to a similar `GraphQlInterceptor` chain that you can use to intercept GraphQL over RSocket requests. @@ -517,7 +518,7 @@ public class RequestAttributesAccessor implements ThreadLocalAccessor { A `ThreadLocalAccessor` can be registered in the <> builder. The Boot starter detects beans of this type and automatically registers them for Spring MVC application, see the -{spring-boot-ref-docs}/web.html#web.graphql.web-endpoints[Web Endpoints] section. +{spring-boot-ref-docs}/web.html#web.graphql.transports.http-websocket[Web Endpoints] section. [[execution-context-webflux]] diff --git a/spring-graphql/src/main/java/org/springframework/graphql/client/GraphQlClient.java b/spring-graphql/src/main/java/org/springframework/graphql/client/GraphQlClient.java index 42c6e49d..e73a5d42 100644 --- a/spring-graphql/src/main/java/org/springframework/graphql/client/GraphQlClient.java +++ b/spring-graphql/src/main/java/org/springframework/graphql/client/GraphQlClient.java @@ -185,7 +185,11 @@ public interface GraphQlClient { RequestSpec attributes(Consumer> attributesConsumer); /** - * Shortcut for {@link #execute()} with a single field path to decode from. + * Shortcut for {@link #execute()} with a field path to decode from. + *

If you want to decode the full data instead, use {@link #execute()}: + *

+		 * client.document("..").execute().map(response -> response.toEntity(..))
+		 * 
* @return a spec with decoding options * @throws FieldAccessException if the target field has any errors, * including nested errors. @@ -193,7 +197,12 @@ public interface GraphQlClient { RetrieveSpec retrieve(String path); /** - * Shortcut for {@link #executeSubscription()} with a single field path to decode from. + * Shortcut for {@link #executeSubscription()} with a field path to + * decode from for each result. + *

If you want to decode the full data, use {@link #executeSubscription()}: + *

+		 * client.document("..").executeSubscription().map(response -> response.toEntity(..))
+		 * 
* @return a spec with decoding options */ RetrieveSubscriptionSpec retrieveSubscription(String path);