Auto-configure SSE support for GraphQL endpoints

This commit auto-configures the newly supported SSE transport for
GraphQL endpoints in both Spring MVC and WebFlux.

Closes gh-39651
This commit is contained in:
Brian Clozel
2024-03-11 14:52:33 +01:00
parent e0ee4817d6
commit 08626d3591
6 changed files with 82 additions and 12 deletions

View File

@@ -87,6 +87,7 @@ are detected by Spring Boot and considered as candidates for `DataFetcher` for m
[[web.graphql.transports.http-websocket]]
==== HTTP and WebSocket
The GraphQL HTTP endpoint is at HTTP POST `/graphql` by default.
It also supports the `"text/event-stream"` media type over Server Sent Events for subscriptions only.
The path can be customized with configprop:spring.graphql.path[].
TIP: The HTTP endpoint for both Spring MVC and Spring WebFlux is provided by a `RouterFunction` bean with an `@Order` of `0`.