public final class RealApolloCall<T> extends java.lang.Object implements ApolloQueryCall<T>, ApolloMutationCall<T>
| Modifier and Type | Class and Description |
|---|---|
static class |
RealApolloCall.Builder<T> |
ApolloQueryCall.FactoryApolloMutationCall.FactoryApolloCall.Callback<T>| Modifier and Type | Method and Description |
|---|---|
static <T> RealApolloCall.Builder<T> |
builder() |
RealApolloCall<T> |
cacheControl(CacheControl cacheControl)
Sets the
CacheControl strategy for an ApolloCall object. |
RealApolloCall<T> |
cacheHeaders(CacheHeaders cacheHeaders)
Sets the
CacheHeaders to use for this call. |
void |
cancel()
Cancels the operation.
|
RealApolloCall<T> |
clone()
Creates a new, identical call to this one which can be enqueued or executed even if this call has already been.
|
void |
enqueue(ApolloCall.Callback<T> responseCallback)
Schedules the request to be executed at some point in the future.
|
com.apollographql.apollo.api.Response<T> |
execute()
Sends the request immediately and blocks until the response can be processed or is an error.
|
RealApolloCall<T> |
httpCachePolicy(HttpCachePolicy.Policy httpCachePolicy)
Sets the http cache policy for response/request cache.
|
boolean |
isCanceled()
Checks if this operation has been canceled.
|
com.apollographql.apollo.api.Operation |
operation()
Returns GraphQl operation this call executes
|
ApolloMutationCall<T> |
refetchQueries(com.apollographql.apollo.api.OperationName... operationNames)
Sets a list of
ApolloQueryWatcher query names to be re-fetched once this mutation completed. |
ApolloMutationCall<T> |
refetchQueries(com.apollographql.apollo.api.Query... queries)
Sets a list of
Query to be re-fetched once this mutation completed. |
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 via
ApolloMutationCall.refetchQueries(OperationName...) |
public static <T> RealApolloCall.Builder<T> builder()
@Nonnull public com.apollographql.apollo.api.Response<T> execute() throws ApolloException
ApolloCallexecute in interface ApolloCall<T>ResponseApolloException - if the request could not be executed due to a cancellation, a timeout, network
failure or a parsing errorpublic void enqueue(@Nullable
ApolloCall.Callback<T> responseCallback)
ApolloCallenqueue in interface ApolloCall<T>responseCallback - Callback which will handle the response or a failure exception.@Nonnull public com.apollographql.apollo.internal.RealApolloQueryWatcher<T> watcher()
ApolloQueryCallApolloMutationCall.refetchQueries(OperationName...)watcher in interface ApolloQueryCall<T>ApolloQueryWatcher@Nonnull public RealApolloCall<T> httpCachePolicy(@Nonnull HttpCachePolicy.Policy httpCachePolicy)
ApolloQueryCallhttpCachePolicy in interface ApolloQueryCall<T>httpCachePolicy - HttpCachePolicy.Policy to setApolloQueryCall with the provided HttpCachePolicy.Policy@Nonnull public RealApolloCall<T> cacheControl(@Nonnull CacheControl cacheControl)
ApolloCallCacheControl strategy for an ApolloCall object.cacheControl in interface ApolloCall<T>cacheControl in interface ApolloQueryCall<T>cacheControl - the CacheControl strategy to set@Nonnull public RealApolloCall<T> cacheHeaders(@Nonnull CacheHeaders cacheHeaders)
ApolloCallCacheHeaders to use for this call.cacheHeaders in interface ApolloCall<T>cacheHeaders in interface ApolloMutationCall<T>cacheHeaders in interface ApolloQueryCall<T>cacheHeaders - the CacheHeaders that will be passed with records generated from this request to NormalizedCache. Standardized cache headers are
defined in ApolloCacheHeaders.CacheHeaders.public void cancel()
Cancelablecancel in interface Cancelablepublic boolean isCanceled()
CancelableisCanceled in interface Cancelable@Nonnull public RealApolloCall<T> clone()
ApolloCallclone in interface ApolloCall<T>clone in interface ApolloMutationCall<T>clone in interface ApolloQueryCall<T>clone in class java.lang.Object@Nonnull public ApolloMutationCall<T> refetchQueries(@Nonnull com.apollographql.apollo.api.OperationName... operationNames)
ApolloMutationCallSets a list of ApolloQueryWatcher query names to be re-fetched once this mutation completed.
refetchQueries in interface ApolloMutationCall<T>operationNames - array of OperationName query names to be re-fetchedApolloMutationCall that will trigger re-fetching provided queries@Nonnull public ApolloMutationCall<T> refetchQueries(@Nonnull com.apollographql.apollo.api.Query... queries)
ApolloMutationCallSets a list of Query to be re-fetched once this mutation completed.
refetchQueries in interface ApolloMutationCall<T>queries - array of Query to be re-fetchedApolloMutationCall that will trigger re-fetching provided queries@Nonnull public com.apollographql.apollo.api.Operation operation()
ApolloCalloperation in interface ApolloCall<T>Operationpublic RealApolloCall.Builder<T> toBuilder()