public final class RealAppSyncCall<T> extends java.lang.Object implements AppSyncQueryCall<T>, AppSyncMutationCall<T>
| Modifier and Type | Class and Description |
|---|---|
static class |
RealAppSyncCall.Builder<T> |
AppSyncQueryCall.FactoryAppSyncMutationCall.FactoryGraphQLCall.Callback<T>, GraphQLCall.StatusEvent| Modifier and Type | Method and Description |
|---|---|
static <T> RealAppSyncCall.Builder<T> |
builder() |
RealAppSyncCall<T> |
cacheHeaders(CacheHeaders cacheHeaders)
Sets the
CacheHeaders to use for this call. |
void |
cancel()
Cancels this
GraphQLCall. |
RealAppSyncCall<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(GraphQLCall.Callback<T> responseCallback)
Schedules the request to be executed at some point in the future.
|
RealAppSyncCall<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
|
AppSyncMutationCall<T> |
refetchQueries(com.apollographql.apollo.api.OperationName... operationNames)
Sets a list of
AppSyncQueryWatcher query names to be re-fetched once this mutation completed. |
AppSyncMutationCall<T> |
refetchQueries(com.apollographql.apollo.api.Query... queries)
Sets a list of
Query to be re-fetched once this mutation completed. |
RealAppSyncCall<T> |
responseFetcher(ResponseFetcher fetcher)
Sets the
ResponseFetcher strategy for an GraphQLCall object. |
RealAppSyncCall.Builder<T> |
toBuilder() |
com.apollographql.apollo.internal.RealAppSyncQueryWatcher<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
AppSyncMutationCall.refetchQueries(OperationName...) |
public static <T> RealAppSyncCall.Builder<T> builder()
public void enqueue(@Nullable
GraphQLCall.Callback<T> responseCallback)
GraphQLCallenqueue in interface GraphQLCall<T>responseCallback - Callback which will handle the response or a failure exception.@Nonnull public com.apollographql.apollo.internal.RealAppSyncQueryWatcher<T> watcher()
AppSyncQueryCallAppSyncMutationCall.refetchQueries(OperationName...)watcher in interface AppSyncQueryCall<T>AppSyncQueryWatcher@Nonnull public RealAppSyncCall<T> httpCachePolicy(@Nonnull com.apollographql.apollo.api.cache.http.HttpCachePolicy.Policy httpCachePolicy)
AppSyncQueryCallhttpCachePolicy in interface AppSyncQueryCall<T>httpCachePolicy - HttpCachePolicy.Policy to setAppSyncQueryCall with the provided HttpCachePolicy.Policy@Nonnull public RealAppSyncCall<T> responseFetcher(@Nonnull ResponseFetcher fetcher)
AppSyncQueryCallResponseFetcher strategy for an GraphQLCall object.responseFetcher in interface AppSyncQueryCall<T>fetcher - the ResponseFetcher to use.@Nonnull public RealAppSyncCall<T> cacheHeaders(@Nonnull CacheHeaders cacheHeaders)
AppSyncQueryCallCacheHeaders to use for this call. FetchOptions will
be configured with this headers, and will be accessible from the ResponseFetcher used for this call.cacheHeaders in interface AppSyncMutationCall<T>cacheHeaders in interface AppSyncQueryCall<T>cacheHeaders in interface GraphQLCall<T>cacheHeaders - the CacheHeaders that will be passed with records generated from this request to NormalizedCache. Standardized cache headers are
defined in GraphQLCacheHeaders.CacheHeaders.public void cancel()
GraphQLCallGraphQLCall. If the call has already completed, nothing will happen.
If the call is outgoing, an ApolloCanceledException will be thrown if the call was started
with #execute(). If the call was started with GraphQLCall.enqueue(Callback)
the GraphQLCall.Callback will be disposed, and will receive no more events. The
call will attempt to abort and release resources, if possible.cancel in interface GraphQLCall<T>cancel in interface Cancelablepublic boolean isCanceled()
CancelableisCanceled in interface Cancelable@Nonnull public RealAppSyncCall<T> clone()
GraphQLCallclone in interface AppSyncMutationCall<T>clone in interface AppSyncQueryCall<T>clone in interface GraphQLCall<T>clone in class java.lang.Object@Nonnull public AppSyncMutationCall<T> refetchQueries(@Nonnull com.apollographql.apollo.api.OperationName... operationNames)
AppSyncMutationCallSets a list of AppSyncQueryWatcher query names to be re-fetched once this mutation completed.
refetchQueries in interface AppSyncMutationCall<T>operationNames - array of OperationName query names to be re-fetchedAppSyncMutationCall that will trigger re-fetching provided queries@Nonnull public AppSyncMutationCall<T> refetchQueries(@Nonnull com.apollographql.apollo.api.Query... queries)
AppSyncMutationCallSets a list of Query to be re-fetched once this mutation completed.
refetchQueries in interface AppSyncMutationCall<T>queries - array of Query to be re-fetchedAppSyncMutationCall that will trigger re-fetching provided queries@Nonnull public com.apollographql.apollo.api.Operation operation()
GraphQLCalloperation in interface GraphQLCall<T>Operationpublic RealAppSyncCall.Builder<T> toBuilder()