Stylianos Gakis
12/07/2023, 4:26 PMwatchapolloClient.query(MyQuery)
      .fetchPolicy(FetchPolicy.CacheOnly)
      .watch(true, true) // also tried with `watch(true, true)` etc.
      .onEach {
        logcat { "watchMessages: #1" }
      }
      .retryWhen { cause, _ ->
        cause is CacheMissException ||
          (cause is ApolloCompositeException && cause.suppressedExceptions.any { it is CacheMissException })
      }
      ...CacheMissExceptionreturn flow {
      logcat { "watchMessages: #0.5" }
      emitAll(<the snippet above>)
}Stylianos Gakis
12/07/2023, 4:27 PMwatch3.8.2mbonnin
12/07/2023, 4:33 PMmbonnin
12/07/2023, 4:33 PMfetchThrowsmbonnin
12/07/2023, 4:34 PMStylianos Gakis
12/07/2023, 4:39 PM.watch(fetchThrows = true, refetchThrows = true)logcat { "watchMessages: #1" }retryWhenStylianos Gakis
12/07/2023, 4:47 PMinsideStylianos Gakis
12/07/2023, 4:47 PMStylianos Gakis
12/07/2023, 4:54 PM.retryWhen { cause, _ ->
        val shouldRetry = cause is CacheMissException ||
          (cause is ApolloCompositeException && cause.suppressedExceptions.any { it is CacheMissException })ApolloCompositeExceptionmbonnin
12/07/2023, 11:14 PM```cause is CacheMissException ||
(cause is ApolloCompositeException && cause.suppressedExceptions.any { it is CacheMissException })```I don't think you need the
ApolloCompositeExceptionCacheOnlymbonnin
12/07/2023, 11:15 PMApolloCompositeExceptionCacheFirstNetworkFirstCacheAndNetworkmbonnin
12/07/2023, 11:15 PMStylianos Gakis
12/07/2023, 11:36 PMmbonnin
12/07/2023, 11:42 PMApolloCompositeExceptionCacheFirstmbonnin
12/07/2023, 11:43 PMmbonnin
12/07/2023, 11:43 PM