WebSocketNetworkTransport

A NetworkTransport that manages a single instance of a WebSocketConnection.

Usually it is used with subscriptions but some WsProtocols like GraphQLWsProtocol also support queries and mutations.

The WebSocketConnection is opened when the first subscription is started and closed if there are no active subscriptions after a given timeout.

Types

Link copied to clipboard
class Builder

Properties

Link copied to clipboard
val subscriptionCount: StateFlow<Int>

Functions

Link copied to clipboard

Close the connection to the server (if it's open).

Link copied to clipboard

Closes the websocket connection if the transport is a WebSocketNetworkTransport.

Closes the websocket connection if the transport is a WebSocketNetworkTransport.

Link copied to clipboard
open override fun dispose()
Link copied to clipboard
open override fun <D : Operation.Data> execute(request: ApolloRequest<D>): Flow<ApolloResponse<D>>

Execute a request.