Merge branch '1.0.x'

This commit is contained in:
rstoyanchev
2022-07-19 16:30:09 +01:00
2 changed files with 20 additions and 10 deletions

View File

@@ -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 <<server-rsocket>> 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 <<server-interception,WebGraphHandler>>
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]]

View File

@@ -185,7 +185,11 @@ public interface GraphQlClient {
RequestSpec attributes(Consumer<Map<String, Object>> attributesConsumer);
/**
* Shortcut for {@link #execute()} with a single field path to decode from.
* Shortcut for {@link #execute()} with a field path to decode from.
* <p>If you want to decode the full data instead, use {@link #execute()}:
* <pre>
* client.document("..").execute().map(response -> response.toEntity(..))
* </pre>
* @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.
* <p>If you want to decode the full data, use {@link #executeSubscription()}:
* <pre>
* client.document("..").executeSubscription().map(response -> response.toEntity(..))
* </pre>
* @return a spec with decoding options
*/
RetrieveSubscriptionSpec retrieveSubscription(String path);