File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
spring-graphql-docs/src/docs/asciidoc Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -258,6 +258,7 @@ the following:
258
258
- Detect https://www.graphql-java.com/documentation/instrumentation[Instrumentation] beans for
259
259
{spring-boot-ref-docs}/actuator.html#actuator.metrics.supported.spring-graphql[GraphQL metrics].
260
260
- Detect `DataFetcherExceptionResolver` beans for <<execution-exceptions, exception resolution>>.
261
+ - Detect `SubscriptionExceptionResolver` beans for <<execution-exceptions-subsctiption, subscription exception resolution>>.
261
262
262
263
For further customizations, you can declare your own `GraphQlSourceBuilderCustomizer` beans;
263
264
for example, for configuring your own `ExecutionIdProvider`:
@@ -565,6 +566,22 @@ Unresolved exception are logged at ERROR level along with the `executionId` to c
565
566
to the error sent to the client. Resolved exceptions are logged at DEBUG level.
566
567
567
568
569
+ [[execution-exceptions-subsctiption]]
570
+ ==== Subscription Exceptions
571
+
572
+ The `Publisher` for a subscription request may complete with an error signal in which case
573
+ the underlying transport (e.g. WebSocket) sends a final "error" type message with a list
574
+ of GraphQL errors.
575
+
576
+ `DataFetcherExceptionResolver` cannot resolve errors from a subscription `Publisher`,
577
+ since the data `DataFetcher` only creates the `Publisher` initially. After that, the
578
+ transport subscribes to the `Publisher` that may then complete with an error.
579
+
580
+ An application can register a `SubscriptionExceptionResolver` in order to resolve
581
+ exceptions from a subscription `Publisher` in order to resolve those to GraphQL errors
582
+ to send to the client.
583
+
584
+
568
585
569
586
[[execution-batching]]
570
587
=== Batch Loading
You can’t perform that action at this time.
0 commit comments