Class ApolloWSHandler

    • Constructor Detail

      • ApolloWSHandler

        public ApolloWSHandler​(Object delegate)
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • connectionHandler

        public ApolloWSHandler connectionHandler​(Handler<ServerWebSocket> connectionHandler)
        Customize the connection . This handler will be called at the beginning of each websocket connection.
        Parameters:
        connectionHandler -
        Returns:
        a reference to this, so the API can be used fluently
      • connectionInitHandler

        public ApolloWSHandler connectionInitHandler​(Handler<ApolloWSConnectionInitEvent> connectionInitHandler)
        Customize the connection init . This handler will be called when the message is received.
        Parameters:
        connectionInitHandler -
        Returns:
        a reference to this, so the API can be used fluently
      • messageHandler

        public ApolloWSHandler messageHandler​(Handler<ApolloWSMessage> messageHandler)
        Customize the message . This handler will be called for each ApolloWSMessage received.
        Parameters:
        messageHandler -
        Returns:
        a reference to this, so the API can be used fluently
      • endHandler

        public ApolloWSHandler endHandler​(Handler<ServerWebSocket> endHandler)
        Customize the end . This handler will be called at the end of each websocket connection.
        Parameters:
        endHandler -
        Returns:
        a reference to this, so the API can be used fluently
      • queryContext

        @Deprecated
        public ApolloWSHandler queryContext​(Function<ApolloWSMessage,​Object> factory)
        Deprecated.
        Customize the query context object. The provided factory method will be invoked for each incoming GraphQL request.
        Parameters:
        factory -
        Returns:
        a reference to this, so the API can be used fluently
      • create

        public 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.

        Parameters:
        graphQL -
        Returns:
      • create

        public 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:
        graphQL -
        options - options for configuring the ApolloWSOptions
        Returns:
      • dataLoaderRegistry

        @Deprecated
        public ApolloWSHandler dataLoaderRegistry​(Function<ApolloWSMessage,​org.dataloader.DataLoaderRegistry> factory)
        Deprecated.
        Customize the . The provided factory method will be invoked for each incoming GraphQL request.
        Parameters:
        factory -
        Returns:
        a reference to this, so the API can be used fluently
      • locale

        @Deprecated
        public ApolloWSHandler locale​(Function<ApolloWSMessage,​Locale> factory)
        Deprecated.
        Customize the passed to the GraphQL execution engine. The provided factory method will be invoked for each incoming GraphQL request.
        Parameters:
        factory -
        Returns:
        a reference to this, so the API can be used fluently