WebSocketNetworkTransport

Deprecated

The websocket implementation has moved to 'com.apollographql.apollo.network.websocket'. See https://go.apollo.dev/ak-v5-websockets for more details.

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

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()

Closes the WebSocket. Active subscriptions stop receiving events.

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

Execute a request.