Package com.trib3.graphql.websocket

Types

GraphQLContextWebSocketCreatorFactory
Link copied to clipboard
interface GraphQLContextWebSocketCreatorFactory
GraphQLCoroutine
Link copied to clipboard
abstract class GraphQLCoroutine(channel: Channel<OperationMessage<*>>)
Base class for child coroutines of the GraphQLWebSocketConsumer.
GraphQLWebSocketAdapter
Link copied to clipboard
open class GraphQLWebSocketAdapter(channel: Channel<OperationMessage<*>>, objectMapper: ObjectMapper, dispatcher: CoroutineDispatcher) : WebSocketAdapter, CoroutineScope
WebSocketAdapter implementation that bridges incoming WebSocket events into a coroutine Channel to be handled by a consumer, and provides access to the remote for sending messages to the client.
GraphQLWebSocketConsumer
Link copied to clipboard
class GraphQLWebSocketConsumer(graphQL: GraphQL, graphQLConfig: GraphQLConfig, upgradeContainerRequestContext: ContainerRequestContext, channel: Channel<OperationMessage<*>>, adapter: GraphQLWebSocketAdapter, keepAliveDispatcher: CoroutineDispatcher, dataLoaderRegistryFactory: DataLoaderRegistryFactory?, graphQLWebSocketAuthenticator: GraphQLWebSocketAuthenticator?)
Coroutine based consumer that listens for events on coming from the WebSocket managed by a GraphQLWebSocketAdapter, and implements the apollo graphql-ws protocol from https://github.com/apollographql/subscriptions-transport-ws/blob/HEAD/PROTOCOL.
GraphQLWebSocketCreator
Link copied to clipboard
class GraphQLWebSocketCreator(graphQL: GraphQL, objectMapper: ObjectMapper, graphQLConfig: GraphQLConfig, containerRequestContext: ContainerRequestContext, dataLoaderRegistryFactory: DataLoaderRegistryFactory?, graphQLWebSocketAuthenticator: GraphQLWebSocketAuthenticator?) : WebSocketCreator
WebSocketCreator that creates a GraphQLWebSocketAdapter, a Channel that gets sent WebSocket API events, and a GraphQLWebSocketConsumer to consume that channel.
GraphQLWebSocketCreatorFactory
Link copied to clipboard
class GraphQLWebSocketCreatorFactory @Inject() constructor(graphQL: GraphQL, objectMapper: ObjectMapper, graphQLConfig: GraphQLConfig, @Nullable() dataLoaderRegistryFactory: DataLoaderRegistryFactory?, @Nullable() graphQLWebSocketAuthenticator: GraphQLWebSocketAuthenticator?) : GraphQLContextWebSocketCreatorFactory
Factory for getting a GraphQLWebSocketCreator for a given context
GraphQLWebSocketDropwizardAuthenticator
Link copied to clipboard
class GraphQLWebSocketDropwizardAuthenticator @Inject() constructor(@Nullable() authFilter: AuthFilter<*, *>?) : Function1<@JvmSuppressWildcards() ContainerRequestContext, @JvmSuppressWildcards() Principal?>
A GraphQLWebSocketAuthenticator that delegates authentication to a Dropwizard AuthFilter from the Guice injector.
KeepAliveCoroutine
Link copied to clipboard
class KeepAliveCoroutine(graphQLConfig: GraphQLConfig, channel: Channel<OperationMessage<*>>, message: OperationMessage<*>) : GraphQLCoroutine
Coroutine that sends a keepalive ping over the websocket every GraphQLConfig.keepAliveIntervalSeconds seconds until it gets canceled by its parent
OperationMessage
Link copied to clipboard
data class OperationMessage<T : Any>(type: OperationType<T>?, id: String?, payload: T?)
Model for a message in the graphql websocket protocolhttps://github.com/apollographql/subscriptions-transport-ws/blob/HEAD/PROTOCOL.
OperationType
Link copied to clipboard
data class OperationType<T : Any>(type: String, payloadType: KClass<T>)
Captures the mapping from operation type to payload type for the messages in the protocol
QueryCoroutine
Link copied to clipboard
class QueryCoroutine(graphQL: GraphQL, context: GraphQLContext, channel: Channel<OperationMessage<*>>, messageId: String, payload: GraphQLRequest, dataLoaderRegistryFactory: DataLoaderRegistryFactory?) : GraphQLCoroutine
Coroutine that runs a GraphQL query and emits data messages to be sent back to the WebSocket client.

Properties

log
Link copied to clipboard
private val log: KLogger
log
Link copied to clipboard
private val log: KLogger