io.vertx.ext.web.handler.graphql

## Interface ApolloWSHandler

- All Superinterfaces:
    Handler<RoutingContext>, ProtocolUpgradeHandler

      public interface ApolloWSHandler
      extends ProtocolUpgradeHandler

  A handler for GraphQL requests sent over Apollo's `subscriptions-transport-ws` transport.
  Author:
    Rogelio Orts

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `ApolloWSHandler` | `beforeExecute(Handler<ExecutionInputBuilderWithContext<ApolloWSMessage>> config)` Set a callback to invoke before executing a GraphQL query.
    `ApolloWSHandler` | `connectionHandler(Handler<ServerWebSocket> connectionHandler)` Customize the connection `Handler`.
    `ApolloWSHandler` | `connectionInitHandler(Handler<ApolloWSConnectionInitEvent> connectionInitHandler)` Customize the connection init `Handler`.
    `static ApolloWSHandler` | `create(graphql.GraphQL graphQL)` Create a new `ApolloWSHandler` that will use the provided `graphQL` object to execute requests.
    `static ApolloWSHandler` | `create(graphql.GraphQL graphQL, ApolloWSOptions options)` Create a new `ApolloWSHandler` that will use the provided `graphQL` object to execute requests.
    `ApolloWSHandler` | `dataLoaderRegistry(java.util.function.Function<ApolloWSMessage,org.dataloader.DataLoaderRegistry> factory)` Deprecated. as of 4.2, use `beforeExecute(Handler)` instead
    `ApolloWSHandler` | `endHandler(Handler<ServerWebSocket> endHandler)` Customize the end `Handler`.
    `static ApolloWSMessage` | `getMessage(graphql.GraphQLContext graphQlContext)` Retrieves the `ApolloWSMessage` from the `GraphQLContext`.
    `ApolloWSHandler` | `locale(java.util.function.Function<ApolloWSMessage,Locale> factory)` Deprecated. as of 4.2, use `beforeExecute(Handler)` instead
    `ApolloWSHandler` | `messageHandler(Handler<ApolloWSMessage> messageHandler)` Customize the message `Handler`.
    `ApolloWSHandler` | `queryContext(java.util.function.Function<ApolloWSMessage,Object> factory)` Deprecated. as of 4.2, use `beforeExecute(Handler)` instead

    - ### Methods inherited from interface io.vertx.core.Handler

      `handle`

- - ### Method Detail

    - #### create

          static ApolloWSHandler create(graphql.GraphQL graphQL)

      Create a new `ApolloWSHandler` that will use the provided `graphQL` object to execute requests.

      The handler will be configured with the default `ApolloWSOptions`.

    - #### create

          static ApolloWSHandler create(graphql.GraphQL graphQL,
                                        ApolloWSOptions options)

      Create a new `ApolloWSHandler` that will use the provided `graphQL` object to execute requests.

      The handler will be configured with the given `options`.

      Parameters:
        `options` - options for configuring the `ApolloWSOptions`

    - #### getMessage

          static ApolloWSMessage getMessage(graphql.GraphQLContext graphQlContext)

      Retrieves the `ApolloWSMessage` from the `GraphQLContext`.
      Parameters:
        `graphQlContext` - the GraphQL context object
      Returns:
        the `ApolloWSMessage`

    - #### connectionHandler

          ApolloWSHandler connectionHandler(Handler<ServerWebSocket> connectionHandler)

      Customize the connection `Handler`. This handler will be called at the beginning of each websocket connection.
      Returns:
        a reference to this, so the API can be used fluently

    - #### connectionInitHandler

          ApolloWSHandler connectionInitHandler(Handler<ApolloWSConnectionInitEvent> connectionInitHandler)

      Customize the connection init `Handler`. This handler will be called when the `ApolloWSMessageType.CONNECTION_INIT` message is received.
      Returns:
        a reference to this, so the API can be used fluently

    - #### messageHandler

          ApolloWSHandler messageHandler(Handler<ApolloWSMessage> messageHandler)

      Customize the message `Handler`. This handler will be called for each `ApolloWSMessage` received.
      Returns:
        a reference to this, so the API can be used fluently

    - #### endHandler

          ApolloWSHandler endHandler(Handler<ServerWebSocket> endHandler)

      Customize the end `Handler`. This handler will be called at the end of each websocket connection.
      Returns:
        a reference to this, so the API can be used fluently

    - #### queryContext

          @Deprecated
          ApolloWSHandler queryContext(java.util.function.Function<ApolloWSMessage,Object> factory)

      Deprecated. as of 4.2, use `beforeExecute(Handler)` instead
      Customize the query context object. The provided `factory` method will be invoked for each incoming GraphQL request.
      Returns:
        a reference to this, so the API can be used fluently

    - #### dataLoaderRegistry

          @Deprecated
          ApolloWSHandler dataLoaderRegistry(java.util.function.Function<ApolloWSMessage,org.dataloader.DataLoaderRegistry> factory)

      Deprecated. as of 4.2, use `beforeExecute(Handler)` instead
      Customize the `DataLoaderRegistry`. The provided `factory` method will be invoked for each incoming GraphQL request.
      Returns:
        a reference to this, so the API can be used fluently

    - #### locale

          @Deprecated
          ApolloWSHandler locale(java.util.function.Function<ApolloWSMessage,Locale> factory)

      Deprecated. as of 4.2, use `beforeExecute(Handler)` instead
      Customize the `Locale` passed to the GraphQL execution engine. The provided `factory` method will be invoked for each incoming GraphQL request.
      Returns:
        a reference to this, so the API can be used fluently

    - #### beforeExecute

          ApolloWSHandler beforeExecute(Handler<ExecutionInputBuilderWithContext<ApolloWSMessage>> config)

      Set a callback to invoke before executing a GraphQL query.
      Parameters:
        `config` - the callback to invoke
      Returns:
        a reference to this, so the API can be used fluently

Copyright © 2022 Eclipse. All rights reserved.