Interface WebSocketGraphQlClient

All Superinterfaces:
GraphQlClient, WebGraphQlClient

public interface WebSocketGraphQlClient extends WebGraphQlClient
GraphQL over WebSocket client that uses WebSocketClient.
Since:
1.0.0
Author:
Rossen Stoyanchev
  • Method Details

    • start

      reactor.core.publisher.Mono<Void> start()
      Start the GraphQL session by connecting the WebSocket, sending the "connection_init" and receiving the "connection_ack" message.

      Note: Only one session is started at a time. Additional attempts to start have no impact while a session is active.

      Returns:
      Mono that completes when the WebSocket is connected and the GraphQL session is ready to send requests
    • stop

      reactor.core.publisher.Mono<Void> stop()
      Stop the GraphQL session by closing the WebSocket with CloseStatus.NORMAL and terminating in-progress requests with an error signal.

      New requests are rejected from the time of this call. If necessary, call start() to allow requests again.

      Returns:
      Mono that completes when the underlying session is closed
    • mutate

      Description copied from interface: GraphQlClient
      Return a builder initialized from the configuration of "this" client to use to build a new, independently configured client instance.
      Specified by:
      mutate in interface GraphQlClient
      Specified by:
      mutate in interface WebGraphQlClient
    • create

      static WebSocketGraphQlClient create(URI url, WebSocketClient webSocketClient)
      Parameters:
      url - the GraphQL endpoint URL
      webSocketClient - the underlying transport client to use
    • builder

      static WebSocketGraphQlClient.Builder<?> builder(String url, WebSocketClient webSocketClient)
      Return a builder for a WebSocketGraphQlClient.
      Parameters:
      url - the GraphQL endpoint URL
      webSocketClient - the underlying transport client to use
    • builder

      static WebSocketGraphQlClient.Builder<?> builder(URI url, WebSocketClient webSocketClient)
      Return a builder for a WebSocketGraphQlClient.
      Parameters:
      url - the GraphQL endpoint URL
      webSocketClient - the underlying transport client to use