Class RealApolloCall<T>
- java.lang.Object
-
- com.apollographql.apollo.internal.RealApolloCall<T>
-
- All Implemented Interfaces:
ApolloCall<T>,ApolloMutationCall<T>,ApolloQueryCall<T>,Cancelable
public final class RealApolloCall<T> extends java.lang.Object implements ApolloQueryCall<T>, ApolloMutationCall<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRealApolloCall.Builder<T>-
Nested classes/interfaces inherited from interface com.apollographql.apollo.ApolloCall
ApolloCall.Callback<T>, ApolloCall.StatusEvent
-
Nested classes/interfaces inherited from interface com.apollographql.apollo.ApolloMutationCall
ApolloMutationCall.Factory
-
Nested classes/interfaces inherited from interface com.apollographql.apollo.ApolloQueryCall
ApolloQueryCall.Factory
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> RealApolloCall.Builder<T>builder()RealApolloCall<T>cacheHeaders(com.apollographql.apollo.cache.CacheHeaders cacheHeaders)Sets theCacheHeadersto use for this call.voidcancel()Cancels thisApolloCall.RealApolloCall<T>clone()Creates a new, identical call to this one which can be enqueued or executed even if this call has already been.voidenqueue(ApolloCall.Callback<T> responseCallback)Schedules the request to be executed at some point in the future.RealApolloCall<T>httpCachePolicy(com.apollographql.apollo.api.cache.http.HttpCachePolicy.Policy httpCachePolicy)Sets the http cache policy for response/request cache.booleanisCanceled()Checks if this operation has been canceled.com.apollographql.apollo.api.Operationoperation()Returns GraphQL operation this call executesApolloMutationCall<T>refetchQueries(com.apollographql.apollo.api.OperationName... operationNames)Sets a list ofApolloQueryWatcherquery names to be re-fetched once this mutation completed.ApolloMutationCall<T>refetchQueries(com.apollographql.apollo.api.Query... queries)Sets a list ofQueryto be re-fetched once this mutation completed.RealApolloCall<T>requestHeaders(RequestHeaders requestHeaders)Sets theRequestHeadersto use for this call.RealApolloCall<T>responseFetcher(ResponseFetcher fetcher)Sets theResponseFetcherstrategy for an ApolloCall object.RealApolloCall.Builder<T>toBuilder()com.apollographql.apollo.internal.RealApolloQueryWatcher<T>watcher()Returns a watcher to watch the changes to the normalized cache records this query depends on or when mutation call triggers to re-fetch this query after it completes viaApolloMutationCall.refetchQueries(OperationName...)
-
-
-
Method Detail
-
builder
public static <T> RealApolloCall.Builder<T> builder()
-
enqueue
public void enqueue(@Nullable ApolloCall.Callback<T> responseCallback)Description copied from interface:ApolloCallSchedules the request to be executed at some point in the future.- Specified by:
enqueuein interfaceApolloCall<T>- Parameters:
responseCallback- Callback which will handle the response or a failure exception.
-
watcher
@NotNull public com.apollographql.apollo.internal.RealApolloQueryWatcher<T> watcher()
Description copied from interface:ApolloQueryCallReturns a watcher to watch the changes to the normalized cache records this query depends on or when mutation call triggers to re-fetch this query after it completes viaApolloMutationCall.refetchQueries(OperationName...)- Specified by:
watcherin interfaceApolloQueryCall<T>- Returns:
ApolloQueryWatcher
-
httpCachePolicy
@NotNull public RealApolloCall<T> httpCachePolicy(@NotNull com.apollographql.apollo.api.cache.http.HttpCachePolicy.Policy httpCachePolicy)
Description copied from interface:ApolloQueryCallSets the http cache policy for response/request cache. Deprecated, useApolloQueryCall.toBuilder()to mutate the ApolloCall- Specified by:
httpCachePolicyin interfaceApolloQueryCall<T>- Parameters:
httpCachePolicy-HttpCachePolicy.Policyto set- Returns:
ApolloQueryCallwith the providedHttpCachePolicy.Policy
-
responseFetcher
@NotNull public RealApolloCall<T> responseFetcher(@NotNull ResponseFetcher fetcher)
Description copied from interface:ApolloQueryCallSets theResponseFetcherstrategy for an ApolloCall object. Deprecated, useApolloQueryCall.toBuilder()to mutate the ApolloCall- Specified by:
responseFetcherin interfaceApolloQueryCall<T>- Parameters:
fetcher- theResponseFetcherto use.- Returns:
- The ApolloCall object with the provided CacheControl strategy
-
cacheHeaders
@NotNull public RealApolloCall<T> cacheHeaders(@NotNull com.apollographql.apollo.cache.CacheHeaders cacheHeaders)
Description copied from interface:ApolloQueryCallSets 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, useApolloQueryCall.toBuilder()to mutate the ApolloCall- Specified by:
cacheHeadersin interfaceApolloCall<T>- Specified by:
cacheHeadersin interfaceApolloMutationCall<T>- Specified by:
cacheHeadersin interfaceApolloQueryCall<T>- 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.
-
requestHeaders
@NotNull public RealApolloCall<T> requestHeaders(@NotNull RequestHeaders requestHeaders)
Description copied from interface:ApolloQueryCallSets theRequestHeadersto use for this call. These headers will be added to the HTTP request when it is issued. These headers will be applied after any headers applied by application-level interceptors and will override those if necessary. Deprecated, useApolloQueryCall.toBuilder()to mutate the ApolloCall- Specified by:
requestHeadersin interfaceApolloMutationCall<T>- Specified by:
requestHeadersin interfaceApolloQueryCall<T>- Parameters:
requestHeaders- TheRequestHeadersto use for this request.- Returns:
- The ApolloCall object with the provided
RequestHeaders.
-
cancel
public void cancel()
Description copied from interface:ApolloCallCancels thisApolloCall. If the call was started withApolloCall.enqueue(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 interfaceApolloCall<T>- Specified by:
cancelin interfaceCancelable
-
isCanceled
public boolean isCanceled()
Description copied from interface:CancelableChecks if this operation has been canceled.- Specified by:
isCanceledin interfaceCancelable- Returns:
- true if this operation has been canceled else returns false
-
clone
@NotNull public RealApolloCall<T> clone()
Description copied from interface:ApolloCallCreates a new, identical call to this one which can be enqueued or executed even if this call has already been. Deprecated, useApolloCall.toBuilder()to mutate the ApolloCall- Specified by:
clonein interfaceApolloCall<T>- Specified by:
clonein interfaceApolloMutationCall<T>- Specified by:
clonein interfaceApolloQueryCall<T>- Overrides:
clonein classjava.lang.Object- Returns:
- The cloned ApolloCall object.
-
refetchQueries
@NotNull public ApolloMutationCall<T> refetchQueries(@NotNull com.apollographql.apollo.api.OperationName... operationNames)
Description copied from interface:ApolloMutationCallSets a list of
ApolloQueryWatcherquery names to be re-fetched once this mutation completed.- Specified by:
refetchQueriesin interfaceApolloMutationCall<T>- Parameters:
operationNames- array ofOperationNamequery names to be re-fetched- Returns:
ApolloMutationCallthat will trigger re-fetching provided queries
-
refetchQueries
@NotNull public ApolloMutationCall<T> refetchQueries(@NotNull com.apollographql.apollo.api.Query... queries)
Description copied from interface:ApolloMutationCallSets a list of
Queryto be re-fetched once this mutation completed.- Specified by:
refetchQueriesin interfaceApolloMutationCall<T>- Parameters:
queries- array ofQueryto be re-fetched- Returns:
ApolloMutationCallthat will trigger re-fetching provided queries
-
operation
@NotNull public com.apollographql.apollo.api.Operation operation()
Description copied from interface:ApolloCallReturns GraphQL operation this call executes- Specified by:
operationin interfaceApolloCall<T>- Returns:
Operation
-
toBuilder
@NotNull public RealApolloCall.Builder<T> toBuilder()
- Specified by:
toBuilderin interfaceApolloCall<T>- Specified by:
toBuilderin interfaceApolloMutationCall<T>- Specified by:
toBuilderin interfaceApolloQueryCall<T>
-
-