new ApolloWSHandler()
Methods
connectionHandler(connectionHandler) → {ApolloWSHandler}
Customize the connection .
This handler will be called at the beginning of each websocket connection.
Parameters:
| Name | Type | Description |
|---|---|---|
connectionHandler |
function |
Returns:
a reference to this, so the API can be used fluently
- Type
- ApolloWSHandler
endHandler(endHandler) → {ApolloWSHandler}
Customize the end .
This handler will be called at the end of each websocket connection.
Parameters:
| Name | Type | Description |
|---|---|---|
endHandler |
function |
Returns:
a reference to this, so the API can be used fluently
- Type
- ApolloWSHandler
handle(event)
Something has happened, so handle it.
Parameters:
| Name | Type | Description |
|---|---|---|
event |
RoutingContext | the event to handle |
messageHandler(messageHandler) → {ApolloWSHandler}
Customize the message .
This handler will be called for each ApolloWSMessage received.
Parameters:
| Name | Type | Description |
|---|---|---|
messageHandler |
function |
Returns:
a reference to this, so the API can be used fluently
- Type
- ApolloWSHandler
queryContext(factory) → {ApolloWSHandler}
Customize the query context object.
The provided
factory method will be invoked for each incoming GraphQL request.
Parameters:
| Name | Type | Description |
|---|---|---|
factory |
function |
Returns:
a reference to this, so the API can be used fluently
- Type
- ApolloWSHandler