mateusz.kwiecinski
11/22/2023, 11:51 AMoverride fun intercept(chain: Interceptor.Chain): Response {
if (isAppBlocked()) {
chain.call().cancel()
}
return chain.proceed(chain.request())
}
which results in the query/mutation being cancelled with the following exception 👇
Looking at the documentation, the multi-platform way is to use Apollo's HttpInterceptor
, but it doesn't seem to have a capability to cancel an ongoing request. Does the apollo-kotlin client have an multiplatform-enabled API allowing such behavior somewhere? If not, would you be open to extend the API surface to cancel ongoing network requests?mateusz.kwiecinski
11/22/2023, 11:56 AMbod
11/22/2023, 12:24 PMmateusz.kwiecinski
11/22/2023, 2:11 PMmbonnin
11/22/2023, 2:14 PMHttpEngine
that delegates to the default one (or throws). It's 100% safe to throw ApolloNetworkException
from HttpEngine.execute
, this is what's happening on I/O errorsmbonnin
11/22/2023, 2:14 PMmateusz.kwiecinski
11/22/2023, 2:20 PMYou could implement your own HttpEngineinteresting, thanks for the idea! I'll give it a try 👍