The Normalized Cache in the Apollo Kotlin main repository will not receive new features - they are added here instead. In the future, the main repository version will be deprecated and then removed.
Use in your project
The Normalized Cache requires Apollo Kotlin v4.3.0 or later.
Add the dependencies to your project
// build.gradle.kts
dependencies {
// For the memory cache
implementation("com.apollographql.cache:normalized-cache:1.0.0-beta.1")
// For the SQL cache
implementation("com.apollographql.cache:normalized-cache-sqlite:1.0.0-beta.1")
}
// build.gradle.kts
apollo {
service("service") {
// ...
// Add this
plugin("com.apollographql.cache:normalized-cache-apollo-compiler-plugin:1.0.0-beta.1") {
argument("com.apollographql.cache.packageName", packageName.get())
}
}
}
// For Apollo Kotlin v5 and later
apollo {
service("service") {
// ...
// Add this
plugin("com.apollographql.cache:normalized-cache-apollo-compiler-plugin:1.0.0-beta.1")
pluginArgument("com.apollographql.cache.packageName", packageName.get())
}
}
If you're already using the main repository version, please consult the migration guide.