webSocketServerUrl
Sets the default url of the GraphQL websockets endpoint.
This is a convenience function that configures the underlying WebSocketNetworkTransport. See also subscriptionNetworkTransport for more customization.
See also
Deprecated
Use subscriptionNetworkTransport() directly. See https://go.apollo.dev/ak-v5-websockets for more details.
Configure dynamically the url of the GraphQL server used for WebSockets. Use this function or webSocketServerUrl(String) but not both.
Parameters
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.