John O'Reilly
12/13/2023, 5:26 PMCacheMissException
in StarWars sample (https://github.com/joreilly/StarWars) after moving to v4 (didn't notice when I updated at time as it was using cache I believe)....version in repo is 4.0.0-alpha.2
but see same issue with beta-4. It could be some migration step missing perhaps but just in case any obvious things to look out for? More in 🧵John O'Reilly
12/13/2023, 5:27 PM-13 17:18:28.994 10990 10990 E AndroidRuntime: Process: dev.johnoreilly.starwars.androidApp, PID: 10990
12-13 17:18:28.994 10990 10990 E AndroidRuntime: com.apollographql.apollo3.exception.CacheMissException: Object 'QUERY_ROOT' has no field named 'allPeople'
12-13 17:18:28.994 10990 10990 E AndroidRuntime: at com.apollographql.apollo3.cache.normalized.api.DefaultCacheResolver.resolveField(CacheResolver.kt:97)
12-13 17:18:28.994 10990 10990 E AndroidRuntime: at com.apollographql.apollo3.cache.normalized.api.FieldPolicyCacheResolver.resolveField(CacheResolver.kt:188)
12-13 17:18:28.994 10990 10990 E AndroidRuntime: at com.apollographql.apollo3.cache.normalized.api.internal.CacheBatchReader.toMap(CacheBatchReader.kt:115)
12-13 17:18:28.994 10990 10990 E AndroidRuntime: at com.apollographql.apollo3.cache.normalized.api.OperationCacheExtensionsKt.readInternal(OperationCacheExtensions.kt:78)
12-13 17:18:28.994 10990 10990 E AndroidRuntime: at com.apollographql.apollo3.cache.normalized.api.OperationCacheExtensionsKt.readDataFromCache(OperationCacheExtensions.kt:41)
12-13 17:18:28.994 10990 10990 E AndroidRuntime: at com.apollographql.apollo3.cache.normalized.internal.DefaultApolloStore$readOperation$2.invoke(DefaultApolloStore.kt:103)
12-13 17:18:28.994 10990 10990 E AndroidRuntime: at com.apollographql.apollo3.cache.normalized.internal.DefaultApolloStore$readOperation$2.invoke(DefaultApolloStore.kt:102)
12-13 17:18:28.994 10990 10990 E AndroidRuntime: at com.apollographql.apollo3.cache.normalized.internal.Lock.read(Lock.kt:12)
12-13 17:18:28.994 10990 10990 E AndroidRuntime: at com.apollographql.apollo3.cache.normalized.internal.DefaultApolloStore.readOperation(DefaultApolloStore.kt:102)
12-13 17:18:28.994 10990 10990 E AndroidRuntime: at com.apollographql.apollo3.cache.normalized.internal.ApolloCacheInterceptor.readFromCache(ApolloCacheInterceptor.kt:209)
12-13 17:18:28.994 10990 10990 E AndroidRuntime: at com.apollographql.apollo3.cache.normalized.internal.ApolloCacheInterceptor.access$readFromCache(ApolloCacheInterceptor.kt:38)
12-13 17:18:28.994 10990 10990 E AndroidRuntime: at com.apollographql.apollo3.cache.normalized.internal.ApolloCacheInterceptor$interceptQuery$1.invokeSuspend(ApolloCacheInterceptor.kt:194)
12-13 17:18:28.994 10990 10990 E AndroidRuntime: at com.apollographql.apollo3.cache.normalized.internal.ApolloCacheInterceptor$interceptQuery$1.invoke(Unknown Source:8)
12-13 17:18:28.994 10990 10990 E AndroidRuntime: at com.apollographql.apollo3.cache.normalized.internal.ApolloCacheInterceptor$interceptQuery$1.invoke(Unknown Source:4)
12-13 17:18:28.994 10990 10990 E AndroidRuntime: at kotlinx.coroutines.flow.SafeFlow.collectSafely(Builders.kt:61)
John O'Reilly
12/13/2023, 5:28 PMCacheMissException: Object 'QUERY_ROOT' has no field named 'allPeople'
John O'Reilly
12/13/2023, 5:29 PMbod
12/13/2023, 5:33 PMJohn O'Reilly
12/13/2023, 5:33 PMbod
12/13/2023, 5:35 PMdataAssertNoErrors
so it's normal that it throws in that case actuallybod
12/13/2023, 5:36 PMapolloClient.query(query).watch().filter { it.exception == null }
John O'Reilly
12/13/2023, 5:37 PMbod
12/13/2023, 5:38 PMJohn O'Reilly
12/13/2023, 5:39 PMdataAssertNoErrors
any more (or dataOrThrow
which is current version of that it seems) ?John O'Reilly
12/13/2023, 5:42 PMbod
12/13/2023, 5:52 PMso I shouldn't useit depends, it could be useful in some cases 🙂 But the difference is that previously in v3, the cache miss would not have been emitted, so it would not have thrown.any moredataAssertNoErrors