public interface ApolloInterceptor
Modifier and Type | Interface and Description |
---|---|
static interface |
ApolloInterceptor.CallBack
Handles the responses returned by
ApolloInterceptor |
static class |
ApolloInterceptor.InterceptorResponse
InterceptorResponse class represents the response returned by the
ApolloInterceptor . |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Disposes of the resources which are no longer required.
|
ApolloInterceptor.InterceptorResponse |
intercept(com.apollographql.apollo.api.Operation operation,
ApolloInterceptorChain chain)
Intercepts the outgoing request, performs blocking operations on the request or the response returned by the next
set of interceptors in the chain, and returns an
ApolloInterceptor.InterceptorResponse if the operations succeeded or throws
an exception if the operations failed. |
void |
interceptAsync(com.apollographql.apollo.api.Operation operation,
ApolloInterceptorChain chain,
java.util.concurrent.ExecutorService dispatcher,
ApolloInterceptor.CallBack callBack)
Intercepts the outgoing request and performs non blocking operations on the request or the response returned by
the next set of interceptors in the chain.
|
@Nonnull ApolloInterceptor.InterceptorResponse intercept(com.apollographql.apollo.api.Operation operation, ApolloInterceptorChain chain) throws ApolloException
ApolloInterceptor.InterceptorResponse
if the operations succeeded or throws
an exception if the operations failed.operation
- the GraphQL Operation object contained within the outgoing request.chain
- the ApolloInterceptorChain object containing the next set of interceptors.ApolloException
- if an error occurred while performing operations on the request/response.void interceptAsync(@Nonnull com.apollographql.apollo.api.Operation operation, @Nonnull ApolloInterceptorChain chain, @Nonnull java.util.concurrent.ExecutorService dispatcher, @Nonnull ApolloInterceptor.CallBack callBack)
operation
- the GraphQL Operation object contained within the outgoing request.chain
- the ApolloInterceptorChain object containing the next set of interceptors.dispatcher
- the ExecutorService which dispatches the non blocking operations on the request/response.callBack
- the Callback which will handle the interceptor's response or failure exception.void dispose()
A use case for this method call would be when an ApolloCall
needs to be
cancelled and resources need to be disposed of.