WebSocketNetworkTransport

class WebSocketNetworkTransport : NetworkTransport

A NetworkTransport that works with WebSockets. Usually it is used with subscriptions but some WsProtocols like GraphQLWsProtocol also support queries and mutations.

Parameters

serverUrl

the url to use to establish the WebSocket connection. It can start with 'https://' or 'wss://' (respectively 'http://' or 'ws://' for unsecure versions), both are handled the same way by the underlying code.

webSocketEngine

a WebSocketEngine that can handle the WebSocket

Types

Link copied to clipboard
class Builder

Functions

Link copied to clipboard
fun closeConnection(reason: Throwable)

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

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

Properties

Link copied to clipboard
val subscriptionCount: StateFlow<Int>