Remove DataStore
Before adding Apollo, remove Amplify DataStore from your project.
Remove the DataStore dependency
Remove com.amplifyframework:aws-datastore (or its version catalog alias) from your build.gradle.kts (or libs.versions.toml).
Remove the DataStore plugin
Remove the DataStore plugin from your Application class:
// Remove this line from your Amplify.addPlugin() calls:Amplify.addPlugin(AWSDataStorePlugin())Delete DataStore generated model files
If you used Amplify codegen, delete the generated model classes (for example, Post.java, PostStatus.java, AmplifyModelProvider.java under com/amplifyframework/datastore/generated/model/). These will be replaced by Apollo's generated types.
Remove all Amplify.DataStore.* calls
Remove all DataStore API calls throughout your code:
| DataStore Call | Apollo Replacement |
|---|---|
Amplify.DataStore.save() | Apollo mutations |
Amplify.DataStore.delete() | Apollo mutations |
Amplify.DataStore.query() | Apollo queries |
Amplify.DataStore.observe() | Apollo subscriptions |
Amplify.DataStore.observeQuery() | Apollo cache watchers (see Migrate DataStore to Apollo) |
Amplify.DataStore.clear() | No longer needed (no local DataStore to clear) |
Amplify.DataStore.start() / stop() | No longer needed |