Package com.apollographql.apollo
Interface ApolloCall<T>
-
- All Superinterfaces:
Cancelable
- All Known Subinterfaces:
ApolloMutationCall<T>,ApolloQueryCall<T>
- All Known Implementing Classes:
RealApolloCall
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceApolloCall.Builder<T>static classApolloCall.Callback<T>Communicates responses from a server or offline requests.static classApolloCall.StatusEventRepresents a status event that corresponds to aApolloCallaction
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description ApolloCall<T>cacheHeaders(com.apollographql.apollo.cache.CacheHeaders cacheHeaders)Deprecated.voidcancel()Cancels thisApolloCall.ApolloCall<T>clone()Deprecated.voidenqueue(ApolloCall.Callback<T> callback)Schedules the request to be executed at some point in the future.com.apollographql.apollo.api.Operationoperation()Returns GraphQL operation this call executesApolloCall.Builder<T>toBuilder()-
Methods inherited from interface com.apollographql.apollo.internal.util.Cancelable
isCanceled
-
-
-
-
Method Detail
-
enqueue
void enqueue(@Nullable ApolloCall.Callback<T> callback)Schedules the request to be executed at some point in the future.- Parameters:
callback- Callback which will handle the response or a failure exception.- Throws:
java.lang.IllegalStateException- when the call has already been executed
-
cacheHeaders
@Deprecated @NotNull ApolloCall<T> cacheHeaders(@NotNull com.apollographql.apollo.cache.CacheHeaders cacheHeaders)
Deprecated.Sets theCacheHeadersto use for this call.com.apollographql.apollo.interceptor.FetchOptionswill be configured with this headers, and will be accessible from theResponseFetcherused for this call. Deprecated, usetoBuilder()to mutate the ApolloCall- Parameters:
cacheHeaders- theCacheHeadersthat will be passed with records generated from this request toNormalizedCache. Standardized cache headers are defined inApolloCacheHeaders.- Returns:
- The ApolloCall object with the provided
CacheHeaders.
-
clone
@Deprecated @NotNull ApolloCall<T> clone()
Deprecated.Creates a new, identical call to this one which can be enqueued or executed even if this call has already been. Deprecated, usetoBuilder()to mutate the ApolloCall- Returns:
- The cloned ApolloCall object.
-
operation
@NotNull com.apollographql.apollo.api.Operation operation()
Returns GraphQL operation this call executes- Returns:
Operation
-
cancel
void cancel()
Cancels thisApolloCall. If the call was started withenqueue(Callback), theApolloCall.Callbackwill be disposed, and will receive no more events. The call will attempt to abort and release resources, if possible.- Specified by:
cancelin interfaceCancelable
-
toBuilder
@NotNull ApolloCall.Builder<T> toBuilder()
-
-