This version is the release candidate for Apollo Android 3 ๐. Please try it and report any issues, we'll fix them urgently.
There is documentation and a migration guide. More details are coming soon. In a nutshell, Apollo Android 3 brings, amongst other things:
Compared to beta05, this version changes the default value of generateOptionalOperationVariables, is compatible with Gradle configuration cache and fixes a few other issues.
The default value for the generateOptionalOperationVariables config is now true.
What this means:
Optional parametersFor instance:
query GetTodos($first: Int, $offset: Int) {
todos(first: $first, offset: $offset) {
...Todo
}
}
// Before
val query = GetTodosQuery(100, null)
// After
val query = GetTodosQuery(Optional.Present(100), Optional.Absent)
generateOptionalOperationVariables to false to generate non-optional parameters globally@optional directiveWe think this change will make more sense to the majority of users (and is consistent with Apollo Android v2's behavior) even though it may be more verbose, which is why it is possible to change the behavior via the generateOptionalOperationVariables config.
To keep the beta05 behavior, set generateOptionalOperationVariables to false in your Gradle configuration:
apollo {
generateOptionalOperationVariables.set(false)
}
You can now pass WebSocket related options to the ApolloClient.Builder directly (previously this would have been done via NetworkTransport):
// Before
val apolloClient = ApolloClient.Builder()
// (...)
.subscriptionNetworkTransport(WebSocketNetworkTransport(
serverUrl = "https://example.com/graphql",
idleTimeoutMillis = 1000L,
wsProtocol = SubscriptionWsProtocol.Factory()
))
.build()
// After
val apolloClient = ApolloClient.Builder()
// (...)
.wsProtocol(SubscriptionWsProtocol.Factory())
.webSocketIdleTimeoutMillis(1000L)
.build()
This version upgrades OkHttp to 4.9.3 (from 3.12.11). This means Apollo Android now requires Android apiLevel 21+. As OkHttp 3 enters end of life at the end of the year and the vast majority of devices now support apiLevel 21, we felt this was a reasonable upgrade.
Fetched April 11, 2026