Version 2.4.0 brings multiple new features and bugfixes. Read below for the most important changes and full changelog
Version 2.4.0 brings Multi-Modules support. With Multi-Modules, you can reuse GraphQL fragments from different Gradle modules for better separation of concerns and improved build speed.
Configure your parent module to generate Apollo metadata:
// parent/build.gradle.kts
apollo {
generateApolloMetadata.set(true)
}
And declare your parent module as a dependency of your feature module:
// feature/build.gradle.kts
dependencies {
implementation("com.apollographql.apollo:apollo-runtime:xyz")
// more regular dependencies
// Apollo dependencies
apolloMetadata(project(":parent"))
// You still need to declare the parent module as a regular dependency
implementation(project(":parent"))
}
For more information, read the official documentation
⚠️ Multi-Modules is currently experimental and we'd love to hear how it worked (or not worked) for you. We welcome issues/feedback through the Github Issues
Version 2.4.0 brings even more fixes and tools to work with SDL schemas. SDL schemas are a more concise and readable way to work with GraphQL schemas. To use them, replace schema.json with your SDL schema schema.sdl. You can get a SDL schema from your GraphQL Playground if your endpoint has an associated Playground instance. If you don't have a playground instance or another way to download a SDL file, version 2.4.0 can make an introspection query and save it in SDL format. The schema will be saves as Json or SDL depending on the filename extension:
./gradlew downloadApolloSchema --endpoint https://your.graphql/endpoint --schema src/main/graphql/com/example/schema.sdl
If you're using apollo-coroutines-support, version 2.4.0 brings apolloCall.await() (#2574). It is more concise than the previous apolloCall.toDeferred().await() and also respects structured concurrency. We strongely encourage to move to .await(). Many thanks to @R4md4c for adding this!
The Kotlin 1.4.10 ecosystem is moving forward and we bumped a few dependencies (sqldeligh, okio, kotlin-compile-testing, coroutines and obviously kotlin).
The Gradle plugin is also compiled against Kotlin 1.4.10 despite Gradle forcing Kotlin 1.3.72 at runtime. We compile with apiVersion = "1.3" and our tests do not show any issue but please let us know if you see any weird Gradle behaviour.
Version 2.4.0 fixes how files were written in variables (#2566) and allows to subclass FileUpload to make it work without a File. With Android 11 and scoped storage out of the door, this will allow to upload from a content uri or any other data source. The API was inspired by OkHttp RequestBody. If you ever used OkHttp before, you shouldn't be disoriented:
object upload : FileUpload(mimetype) {
override fun contentLength(): Long {
TODO("return contentLength here")
}
override fun fileName(): String? {
TODO("return fileName to use in the multipart request here")
}
override fun writeTo(sink: BufferedSink) {
TODO("write the data here")
}
}
ApolloCall.await with better structured concurrency support. (#2574)retry() (#2587) Note that this is a behaviour change and this will clone the operation under the hood. If you were calling refetch() directly, you might need to update your calling code.main instead of master (#2594)Many thanks to @R4md4c, @dush1729, @jaggs6 for their awesome work on coroutines, documentation and keeping the project in good shape in general!
Fetched April 11, 2026