# Medium Android App -- Migrating from Apollo Kotlin 3 to 4: Lessons Learned

DevFeed: [Medium Android App -- Migrating from Apollo Kotlin 3 to 4: Lessons Learned](<https://devfeed.tech/articles/medium-android-app-migrating-from-apollo-kotlin-3-to-4-lessons-learned-20324.md>)

Original publisher: [Read original article](<https://medium.engineering/medium-android-app-migrating-from-apollo-kotlin-3-to-4-lessons-learned-ff8d0d861cdb?source=rss----2817475205d3---4>)

Author: Pierrick CAEN

Published: 2025-10-06T08:18:42Z

Content type: tutorial

Language: en

Sources: [Medium](<https://devfeed.tech/sources/medium.md>)

Topics: [GraphQL](<https://devfeed.tech/topics/graphql.md>), [migration](<https://devfeed.tech/topics/migration.md>), [Android](<https://devfeed.tech/topics/android.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Cache](<https://devfeed.tech/topics/cache.md>), [IntelliJ IDEA](<https://devfeed.tech/topics/intellij-idea.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [apollo-client](<https://devfeed.tech/tags/apollo-client.md>), [cache](<https://devfeed.tech/tags/cache.md>), [error-handling](<https://devfeed.tech/tags/error-handling.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [gradle-plugin](<https://devfeed.tech/tags/gradle-plugin.md>), [graphql](<https://devfeed.tech/tags/graphql.md>), [intellij](<https://devfeed.tech/tags/intellij.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [migration](<https://devfeed.tech/tags/migration.md>)

## AI overview

This article describes Medium's migration of its Android app from Apollo Kotlin 3 to 4. It explains the app's use of Apollo's normalized cache, CacheFirst fetching, and watch() for UI updates, then covers identifier changes, revised exception handling, and cache-miss errors encountered during the migration.

## Source excerpt

Photo by Mario Verduzco on UnsplashMedium Android App -- Migrating from Apollo Kotlin 3 to 4: Lessons Learned In this post, I'll share my experience migrating the Medium Android app from Apollo Kotlin version 3 to version 4, including the challenges I encountered and how I solved them to improve our GraphQL implementation. Understanding Our Apollo Cache Implementation Before diving into the migration, it's important to understand how we use Apollo's cache in the Medium Android app. Our app relies heavily on Apollo's normalized cache for several critical purposes: Performance Optimization: We use FetchPolicy.CacheFirst as our default strategy, which means we always try to serve data from the cache first before making network requests. This significantly reduces loading times and provides a smooth user experience, especially when users navigate between screens that display similar content. Real-time Updates: We use Apollo's watch() functionality extensively to observe cache changes and automatically update our UI when data changes. This is particularly useful for features like: Live clap counts on posts Real-time follower updates Post viewed updates and more... Starting the Migration The initial plan was straightforward: update Apollo Kotlin from version 3 to 4. The IntelliJ plugin made this process seem simple at first glance. Key Changes in Apollo Kotlin 4 Group id / plugin id / package name: Apollo Kotlin 4 uses a new identifier (com.apollographql.apollo) for its maven group id, Gradle plugin id, and package name. This change from com.apollographql.apollo3 allows running version 4 alongside version 3 if needed. Source: Apollo Kotlin Migration Guide - Group id / plugin id / package name Exception handling: Apollo 4 has a new way of handling exceptions. Instead of throwing exceptions directly, they're now passed through ApolloResponse. Source: Apollo Kotlin Migration Guide -- Fetch errors do not throw ApolloCompositeException: In Apollo Kotlin 3, when both cache and netw