Class GraphQlWebSocketHandler

java.lang.Object
org.springframework.graphql.server.webflux.GraphQlWebSocketHandler
All Implemented Interfaces:
CorsConfigurationSource, WebSocketHandler

@RegisterReflectionForBinding(GraphQlWebSocketMessage.class) public class GraphQlWebSocketHandler extends Object implements WebSocketHandler, CorsConfigurationSource
WebSocketHandler for GraphQL based on GraphQL Over WebSocket Protocol and for use in a Spring WebFlux application.
Since:
1.0.0
Author:
Rossen Stoyanchev
  • Constructor Details

    • GraphQlWebSocketHandler

      public GraphQlWebSocketHandler(WebGraphQlHandler graphQlHandler, CodecConfigurer codecConfigurer, Duration connectionInitTimeout)
      Create a new instance.
      Parameters:
      graphQlHandler - common handler for GraphQL over WebSocket requests
      codecConfigurer - codec configurer for JSON encoding and decoding
      connectionInitTimeout - how long to wait after the establishment of the WebSocket for the "connection_ini" message from the client.
    • GraphQlWebSocketHandler

      public GraphQlWebSocketHandler(WebGraphQlHandler graphQlHandler, CodecConfigurer codecConfigurer, Duration connectionInitTimeout, @Nullable Duration keepAliveDuration)
      Create a new instance.
      Parameters:
      graphQlHandler - common handler for GraphQL over WebSocket requests
      codecConfigurer - codec configurer for JSON encoding and decoding
      connectionInitTimeout - how long to wait after the establishment of the WebSocket for the "connection_ini" message from the client.
      keepAliveDuration - how frequently to send ping messages when no other messages are sent
      Since:
      1.3.0
    • GraphQlWebSocketHandler

      public GraphQlWebSocketHandler(WebGraphQlHandler graphQlHandler, CodecConfigurer codecConfigurer, Duration connectionInitTimeout, @Nullable Duration keepAliveDuration, @Nullable CorsConfiguration corsConfiguration)
      Create a new instance.
      Parameters:
      graphQlHandler - common handler for GraphQL over WebSocket requests
      codecConfigurer - codec configurer for JSON encoding and decoding
      connectionInitTimeout - how long to wait after the establishment of the WebSocket for the "connection_ini" message from the client.
      keepAliveDuration - how frequently to send ping messages when no other messages are sent
      corsConfiguration - the CORS configuration to use, a null configuration means no CORS check.
      Since:
      1.4.6
  • Method Details