๐ Many thanks to @michgauz, @joeldenke, @rohandhruva, @schoeda, @CoreFloDev and @sproctor for all the feedback ๐
In order to simplify the API and keep the symmetry with ApolloRequest<D> and ApolloResponse<D>, ApolloQueryCall<D, E>, ApolloSubscriptionCall<D, E>, ApolloMutationCall<D, E> are replaced with ApolloCall<D>. This change should be mostly transparent but it's technically a breaking change. If you are passing ApolloQueryCall<D, E> variables, it is safe to drop the second type parameter and use ApolloCall<D> instead.
WebSocketNetworkTransport.reconnectWhen {} (#3674)You now have the option to reconnect a WebSocket automatically when an error happens and re-subscribe automatically after the reconnection has happened. To do so, use the webSocketReconnectWhen parameter:
val apolloClient = ApolloClient.Builder()
.httpServerUrl("http://localhost:8080/graphql")
.webSocketServerUrl("http://localhost:8080/subscriptions")
.wsProtocol(
SubscriptionWsProtocol.Factory(
connectionPayload = {
mapOf("token" to upToDateToken)
}
)
)
.webSocketReconnectWhen {
// this is called when an error happens on the WebSocket
it is ApolloWebSocketClosedException && it.code == 1001
}
.build()
The HttpBatchingEngine has been moved to an HttpInterceptor. You can now configure Http batching with a specific method:
apolloClient = ApolloClient.Builder()
.serverUrl(mockServer.url())
.httpBatching(batchIntervalMillis = 10)
.build()
Rx2Apollo, prefetch(), customAttributes(), ApolloIdlingResource.create()) to help the transition (#3679)WebSocketNetworkTransport.reconnectWhen {} (#3674)Fetched April 11, 2026