webSocketServerUrl

The url of the GraphQL server used for WebSockets Use this function or webSocketServerUrl((suspend () -> String)) but not both.

This is a convenience function that configures the underlying WebSocketNetworkTransport. See also subscriptionNetworkTransport for more customization.

See also


fun webSocketServerUrl(webSocketServerUrl: suspend () -> String?): ApolloClient.Builder

Configure dynamically the url of the GraphQL server used for WebSockets. Use this function or webSocketServerUrl(String) but not both.

Parameters

webSocketServerUrl

a function returning the new server URL. This function will be called every time a WebSocket is opened. For example, you can use it to update your auth credentials in case of an unauthorized error.

It is a suspending function, so it can be used to introduce delay before setting the new server URL.

This is a convenience function that configures the underlying WebSocketNetworkTransport. See also subscriptionNetworkTransport for more customization.

See also