webSocketServerUrl

fun webSocketServerUrl(webSocketServerUrl: String): ApolloClient.Builder

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

See also subscriptionNetworkTransport for more customization


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.