diff --git a/libraries/apollo-debug-server/build.gradle.kts b/libraries/apollo-debug-server/build.gradle.kts index 948b3902315..7808698a736 100644 --- a/libraries/apollo-debug-server/build.gradle.kts +++ b/libraries/apollo-debug-server/build.gradle.kts @@ -24,9 +24,9 @@ kotlin { dependencies { implementation(project(":apollo-normalized-cache")) - - api(project(":apollo-ast")) - api(project(":apollo-api")) + implementation(project(":apollo-normalized-cache-api")) + implementation(project(":apollo-ast")) + api(project(":apollo-runtime")) } } diff --git a/libraries/apollo-debug-server/src/commonMain/kotlin/com/apollographql/apollo3/debugserver/internal/graphql/GraphQL.kt b/libraries/apollo-debug-server/src/commonMain/kotlin/com/apollographql/apollo3/debugserver/internal/graphql/GraphQL.kt index 35b9cba6a81..3686561def8 100644 --- a/libraries/apollo-debug-server/src/commonMain/kotlin/com/apollographql/apollo3/debugserver/internal/graphql/GraphQL.kt +++ b/libraries/apollo-debug-server/src/commonMain/kotlin/com/apollographql/apollo3/debugserver/internal/graphql/GraphQL.kt @@ -84,8 +84,11 @@ internal class GraphQLApolloClient( fun displayName() = id - fun normalizedCaches(): List = runBlocking { apolloClient.apolloStore.dump() }.map { - NormalizedCache(id, it.key, it.value) + fun normalizedCaches(): List { + val apolloStore = runCatching { apolloClient.apolloStore }.getOrNull() ?: return emptyList() + return runBlocking { apolloStore.dump() }.map { + NormalizedCache(id, it.key, it.value) + } } fun normalizedCache(id: String): NormalizedCache? {