@@ -350,9 +350,10 @@ You can use the `GraphQlClient` <<client.graphqlclient.builder>> to customize th
350
350
[[client.subscriptions]]
351
351
== Subscription Requests
352
352
353
- `GraphQlClient` can execute subscriptions over transports that support it. Currently, only
354
- the WebSocket transport supports GraphQL streams, so you'll need to create a
355
- <<client.websocketgraphqlclient,WebSocketGraphQlClient>>.
353
+ `GraphQlClient` can execute subscriptions over transports that support it. Only
354
+ the WebSocket and RSocket transports support GraphQL subscriptions, so you'll need to
355
+ create a <<client.websocketgraphqlclient,WebSocketGraphQlClient>> or
356
+ <<client.rsocketgraphqlclient,RSocketGraphQlClient>>.
356
357
357
358
358
359
@@ -370,18 +371,20 @@ responses, each decoded to some data:
370
371
.toEntity(String.class);
371
372
----
372
373
373
- A subscription stream may end with:
374
-
375
- - `SubscriptionErrorException` if the server ends the
376
- subscription with an explicit "error" message that contains one or more GraphQL errors.
377
- The exception provides access to the GraphQL errors decoded from that message.
378
- - `GraphQlTransportException` such as `WebSocketDisconnectedException` if the underlying
379
- connection is closed or lost in which case you can use the `retry` operator to reestablish
380
- the connection and start the subscription again.
381
-
382
-
374
+ The `Flux` may terminate with `SubscriptionErrorException` if the subscription ends from
375
+ the server side with an "error" message. The exception provides access to GraphQL errors
376
+ decoded from the "error" message.
383
377
378
+ The `Flux` may termiate with `GraphQlTransportException` such as
379
+ `WebSocketDisconnectedException` if the underlying connection is closed or lost. In that
380
+ case you can use the `retry` operator to restart the subscription.
384
381
382
+ To end the subscription from the client side, the `Flux` must be cancelled, and in turn
383
+ the WebSocket transport sends a "complete" message to the server. How to cancel the
384
+ `Flux` depends on how it is used. Some operators such as `take` or `timeout` themselves
385
+ cancel the `Flux`. If you subscribe to the `Flux` with a `Subscriber`, you can get a
386
+ reference to the `Subscription` and cancel through it. The `onSubscribe` operator also
387
+ provides access to the `Subscription`.
385
388
386
389
387
390
[[client.subscriptions.execute]]
0 commit comments