public interface ApolloCall<T> extends Cancelable
ApolloCall is an abstraction for a request that has been prepared for execution. ApolloCall represents a single request/response pair and cannot be executed twice, though it can be cancelled.
In order to execute the request again, call the clone() method which creates a new ApolloCall
object.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
ApolloCall.Builder<T> |
static class |
ApolloCall.Callback<T>
Communicates responses from a server or offline requests.
|
static class |
ApolloCall.StatusEvent
Represents a status event that corresponds to a
ApolloCall action |
| Modifier and Type | Method and Description |
|---|---|
ApolloCall<T> |
cacheHeaders(com.apollographql.apollo.cache.CacheHeaders cacheHeaders)
Deprecated.
|
void |
cancel()
Cancels this
ApolloCall. |
ApolloCall<T> |
clone()
Deprecated.
|
void |
enqueue(ApolloCall.Callback<T> callback)
Schedules the request to be executed at some point in the future.
|
com.apollographql.apollo.api.Operation |
operation()
Returns GraphQL operation this call executes
|
ApolloCall.Builder<T> |
toBuilder() |
isCanceledvoid enqueue(@Nullable
ApolloCall.Callback<T> callback)
callback - Callback which will handle the response or a failure exception.java.lang.IllegalStateException - when the call has already been executed@Deprecated @NotNull ApolloCall<T> cacheHeaders(@NotNull com.apollographql.apollo.cache.CacheHeaders cacheHeaders)
CacheHeaders to use for this call. com.apollographql.apollo.interceptor.FetchOptions will
be configured with this headers, and will be accessible from the ResponseFetcher used for this call.
Deprecated, use toBuilder() to mutate the ApolloCallcacheHeaders - the CacheHeaders that will be passed with records generated from this request to NormalizedCache. Standardized cache headers are
defined in ApolloCacheHeaders.CacheHeaders.@Deprecated @NotNull ApolloCall<T> clone()
toBuilder() to mutate the ApolloCall@NotNull com.apollographql.apollo.api.Operation operation()
Operationvoid cancel()
ApolloCall. If the call was started with enqueue(Callback), the
ApolloCall.Callback will be disposed, and will receive no more events.
The call will attempt to abort and release resources, if possible.cancel in interface Cancelable@NotNull ApolloCall.Builder<T> toBuilder()