diff --git a/spring-graphql/src/main/java/org/springframework/graphql/web/webflux/GraphQlWebSocketHandler.java b/spring-graphql/src/main/java/org/springframework/graphql/web/webflux/GraphQlWebSocketHandler.java index 74cc28cb..8fe56974 100644 --- a/spring-graphql/src/main/java/org/springframework/graphql/web/webflux/GraphQlWebSocketHandler.java +++ b/spring-graphql/src/main/java/org/springframework/graphql/web/webflux/GraphQlWebSocketHandler.java @@ -197,9 +197,8 @@ public class GraphQlWebSocketHandler implements WebSocketHandler { }); } else { - // Single response (query or mutation) - outputFlux = (CollectionUtils.isEmpty(output.getErrors()) ? Flux.just(output) : - Flux.error(new IllegalStateException("Execution failed: " + output.getErrors()))); + // Single response (query or mutation) that may contain errors + outputFlux = Flux.just(output); } return outputFlux @@ -236,4 +235,6 @@ public class GraphQlWebSocketHandler implements WebSocketHandler { private static class SubscriptionExistsException extends RuntimeException { } + + } diff --git a/spring-graphql/src/main/java/org/springframework/graphql/web/webmvc/GraphQlWebSocketHandler.java b/spring-graphql/src/main/java/org/springframework/graphql/web/webmvc/GraphQlWebSocketHandler.java index 50fb2079..ba71c095 100644 --- a/spring-graphql/src/main/java/org/springframework/graphql/web/webmvc/GraphQlWebSocketHandler.java +++ b/spring-graphql/src/main/java/org/springframework/graphql/web/webmvc/GraphQlWebSocketHandler.java @@ -238,9 +238,8 @@ public class GraphQlWebSocketHandler extends TextWebSocketHandler implements Sub }); } else { - // Single response (query or mutation) - outputFlux = (CollectionUtils.isEmpty(output.getErrors()) ? Flux.just(output) - : Flux.error(new IllegalStateException("Execution failed: " + output.getErrors()))); + // Single response (query or mutation) that may contain errors + outputFlux = Flux.just(output); } return outputFlux