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.Factory
ApolloMutationCall.Factory
ApolloCall.Callback<T>, ApolloCall.StatusEvent
Modifier and Type | Method and Description |
---|---|
static <T> RealApolloCall.Builder<T> |
builder() |
RealApolloCall<T> |
cacheHeaders(CacheHeaders cacheHeaders)
Sets the
CacheHeaders to use for this call. |
void |
cancel()
Cancels this
ApolloCall . |
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.
|
RealApolloCall<T> |
httpCachePolicy(com.apollographql.apollo.api.cache.http.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<T> |
requestHeaders(RequestHeaders requestHeaders)
Sets the
RequestHeaders to use for this call. |
RealApolloCall<T> |
responseFetcher(ResponseFetcher fetcher)
Sets the
ResponseFetcher strategy 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 via
ApolloMutationCall.refetchQueries(OperationName...) |
public static <T> RealApolloCall.Builder<T> builder()
public void enqueue(@Nullable ApolloCall.Callback<T> responseCallback)
ApolloCall
enqueue
in interface ApolloCall<T>
responseCallback
- Callback which will handle the response or a failure exception.@NotNull public com.apollographql.apollo.internal.RealApolloQueryWatcher<T> watcher()
ApolloQueryCall
ApolloMutationCall.refetchQueries(OperationName...)
watcher
in interface ApolloQueryCall<T>
ApolloQueryWatcher
@NotNull public RealApolloCall<T> httpCachePolicy(@NotNull com.apollographql.apollo.api.cache.http.HttpCachePolicy.Policy httpCachePolicy)
ApolloQueryCall
httpCachePolicy
in interface ApolloQueryCall<T>
httpCachePolicy
- HttpCachePolicy.Policy
to setApolloQueryCall
with the provided HttpCachePolicy.Policy
@NotNull public RealApolloCall<T> responseFetcher(@NotNull ResponseFetcher fetcher)
ApolloQueryCall
ResponseFetcher
strategy for an ApolloCall object.responseFetcher
in interface ApolloQueryCall<T>
fetcher
- the ResponseFetcher
to use.@NotNull public RealApolloCall<T> cacheHeaders(@NotNull CacheHeaders cacheHeaders)
ApolloQueryCall
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.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
.@NotNull public RealApolloCall<T> requestHeaders(@NotNull RequestHeaders requestHeaders)
ApolloQueryCall
RequestHeaders
to 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.requestHeaders
in interface ApolloMutationCall<T>
requestHeaders
in interface ApolloQueryCall<T>
requestHeaders
- The RequestHeaders
to use for this request.RequestHeaders
.public void cancel()
ApolloCall
ApolloCall
. If the call was started with ApolloCall.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 ApolloCall<T>
cancel
in interface Cancelable
public boolean isCanceled()
Cancelable
isCanceled
in interface Cancelable
@NotNull public RealApolloCall<T> clone()
ApolloCall
clone
in interface ApolloCall<T>
clone
in interface ApolloMutationCall<T>
clone
in interface ApolloQueryCall<T>
clone
in class java.lang.Object
@NotNull public ApolloMutationCall<T> refetchQueries(@NotNull com.apollographql.apollo.api.OperationName... operationNames)
ApolloMutationCall
Sets 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@NotNull public ApolloMutationCall<T> refetchQueries(@NotNull com.apollographql.apollo.api.Query... queries)
ApolloMutationCall
Sets 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@NotNull public com.apollographql.apollo.api.Operation operation()
ApolloCall
operation
in interface ApolloCall<T>
Operation
public RealApolloCall.Builder<T> toBuilder()