Class GraphQLApolloWsController

java.lang.Object
io.micronaut.configuration.graphql.ws.apollo.GraphQLApolloWsController

@Deprecated(since="4.0") @ServerWebSocket(value="${graphql.graphql-apollo-ws.path:/graphql-ws}", subprotocols="graphql-ws") @Requires(property="graphql.graphql-apollo-ws.enabled", value="true", defaultValue="false") public class GraphQLApolloWsController extends Object
Deprecated.
The Apollo subscriptions-transport-ws protocol is deprecated and its usage should be replaced with the new graphql-ws implementation.
The GraphQL websocket controller handling GraphQL requests. Implementation of https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.md
Since:
1.3
Author:
Gerard Klijs
  • Constructor Summary

    Constructors
    Constructor
    Description
    GraphQLApolloWsController(GraphQLApolloWsMessageHandler messageHandler, io.micronaut.configuration.graphql.ws.apollo.GraphQLApolloWsState state, GraphQLJsonSerializer graphQLJsonSerializer)
    Deprecated.
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.reactivestreams.Publisher<GraphQLApolloWsResponse>
    onClose(io.micronaut.websocket.WebSocketSession session, io.micronaut.websocket.CloseReason closeReason)
    Deprecated.
    Called when the websocket is closed.
    org.reactivestreams.Publisher<GraphQLApolloWsResponse>
    onError(io.micronaut.websocket.WebSocketSession session, Throwable t)
    Deprecated.
    Called when there is an error with the websocket, this probably means the connection is lost, but hasn't been properly closed.
    org.reactivestreams.Publisher<GraphQLApolloWsResponse>
    onMessage(String message, io.micronaut.websocket.WebSocketSession session)
    Deprecated.
    Called on every message received from the client.
    void
    onOpen(io.micronaut.websocket.WebSocketSession session, io.micronaut.http.HttpRequest request)
    Deprecated.
    Called when the connection is opened.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • onOpen

      @OnOpen public void onOpen(io.micronaut.websocket.WebSocketSession session, io.micronaut.http.HttpRequest request)
      Deprecated.
      Called when the connection is opened. We store the original request, since it might be needed for the GraphQLInvocation.
      Parameters:
      session - WebSocketSession
      request - HttpRequest
    • onMessage

      @OnMessage public org.reactivestreams.Publisher<GraphQLApolloWsResponse> onMessage(String message, io.micronaut.websocket.WebSocketSession session)
      Deprecated.
      Called on every message received from the client.
      Parameters:
      message - Message received from a client
      session - WebSocketSession
      Returns:
      Publisher<GraphQLApolloWsResponse>
    • onClose

      @OnClose public org.reactivestreams.Publisher<GraphQLApolloWsResponse> onClose(io.micronaut.websocket.WebSocketSession session, io.micronaut.websocket.CloseReason closeReason)
      Deprecated.
      Called when the websocket is closed.
      Parameters:
      session - WebSocketSession
      closeReason - CloseReason
      Returns:
      Publisher<GraphQLApolloWsResponse>
    • onError

      @OnError public org.reactivestreams.Publisher<GraphQLApolloWsResponse> onError(io.micronaut.websocket.WebSocketSession session, Throwable t)
      Deprecated.
      Called when there is an error with the websocket, this probably means the connection is lost, but hasn't been properly closed.
      Parameters:
      session - WebSocketSession
      t - Throwable, the cause of the error
      Returns:
      Publisher<GraphQLApolloWsResponse>