public final class ApolloClient extends java.lang.Object implements AppSyncQueryCall.Factory, AppSyncMutationCall.Factory, AppSyncSubscriptionCall.Factory, AppSyncPrefetch.Factory
See the ApolloClient.Builder class for configuring the ApolloClient.
| Modifier and Type | Class and Description |
|---|---|
static class |
ApolloClient.Builder |
| Modifier and Type | Method and Description |
|---|---|
int |
activeCallsCount()
Returns the count of
GraphQLCall & AppSyncPrefetch objects which are currently in progress. |
ApolloStore |
apolloStore() |
static ApolloClient.Builder |
builder() |
void |
clearHttpCache()
Clear all entries from the
HttpCache, if present. |
GraphQLStoreOperation<java.lang.Boolean> |
clearNormalizedCache()
Clear all entries from the normalized cache.
|
CacheHeaders |
defaultCacheHeaders() |
void |
idleCallback(IdleResourceCallback idleResourceCallback)
Sets the idleResourceCallback which will be called when this ApolloClient is idle.
|
<D extends com.apollographql.apollo.api.Operation.Data,T,V extends com.apollographql.apollo.api.Operation.Variables> |
mutate(com.apollographql.apollo.api.Mutation<D,T,V> mutation)
Creates and prepares a new
AppSyncMutationCall call. |
<D extends com.apollographql.apollo.api.Operation.Data,T,V extends com.apollographql.apollo.api.Operation.Variables> |
mutate(com.apollographql.apollo.api.Mutation<D,T,V> mutation,
D withOptimisticUpdates)
Creates and prepares a new
AppSyncMutationCall call with optimistic updates. |
<D extends com.apollographql.apollo.api.Operation.Data,T,V extends com.apollographql.apollo.api.Operation.Variables> |
prefetch(com.apollographql.apollo.api.Operation<D,T,V> operation)
Prepares the
AppSyncPrefetch which will be executed at some point in the future. |
<D extends com.apollographql.apollo.api.Operation.Data,T,V extends com.apollographql.apollo.api.Operation.Variables> |
query(com.apollographql.apollo.api.Query<D,T,V> query)
Creates and prepares a new
AppSyncQueryCall call. |
<D extends com.apollographql.apollo.api.Operation.Data,T,V extends com.apollographql.apollo.api.Operation.Variables> |
subscribe(com.apollographql.apollo.api.Subscription<D,T,V> subscription) |
public static ApolloClient.Builder builder()
public <D extends com.apollographql.apollo.api.Operation.Data,T,V extends com.apollographql.apollo.api.Operation.Variables> AppSyncMutationCall<T> mutate(@Nonnull com.apollographql.apollo.api.Mutation<D,T,V> mutation)
AppSyncMutationCall.FactoryAppSyncMutationCall call.mutate in interface AppSyncMutationCall.Factorymutation - the Mutation which needs to be performedAppSyncMutationCall call to be executed at some point in the futurepublic <D extends com.apollographql.apollo.api.Operation.Data,T,V extends com.apollographql.apollo.api.Operation.Variables> AppSyncMutationCall<T> mutate(@Nonnull com.apollographql.apollo.api.Mutation<D,T,V> mutation, @Nonnull D withOptimisticUpdates)
AppSyncMutationCall.FactoryCreates and prepares a new AppSyncMutationCall call with optimistic updates.
ApolloStore
immediately before mutation execution. Any AppSyncQueryWatcher dependent on the changed cache records will
be re-fetched.mutate in interface AppSyncMutationCall.Factorymutation - the Mutation which needs to be performedwithOptimisticUpdates - optimistic updates for this mutationAppSyncMutationCall call to be executed at some point in the futurepublic <D extends com.apollographql.apollo.api.Operation.Data,T,V extends com.apollographql.apollo.api.Operation.Variables> AppSyncQueryCall<T> query(@Nonnull com.apollographql.apollo.api.Query<D,T,V> query)
AppSyncQueryCall.FactoryAppSyncQueryCall call.query in interface AppSyncQueryCall.Factoryquery - the operation which needs to be performedAppSyncQueryCall call to be executed at some point in the futurepublic <D extends com.apollographql.apollo.api.Operation.Data,T,V extends com.apollographql.apollo.api.Operation.Variables> AppSyncSubscriptionCall<T> subscribe(@Nonnull com.apollographql.apollo.api.Subscription<D,T,V> subscription)
subscribe in interface AppSyncSubscriptionCall.Factorypublic <D extends com.apollographql.apollo.api.Operation.Data,T,V extends com.apollographql.apollo.api.Operation.Variables> AppSyncPrefetch prefetch(@Nonnull com.apollographql.apollo.api.Operation<D,T,V> operation)
AppSyncPrefetch which will be executed at some point in the future.prefetch in interface AppSyncPrefetch.Factoryoperation - the operation which needs to be performedpublic CacheHeaders defaultCacheHeaders()
CacheHeaders which this instance of ApolloClient was configured.public void clearHttpCache()
HttpCache, if present.@Nonnull public GraphQLStoreOperation<java.lang.Boolean> clearNormalizedCache()
GraphQLStoreOperation operation to executepublic ApolloStore apolloStore()
ApolloStore managing access to the normalized cache created by ApolloClient.Builder.normalizedCache(NormalizedCacheFactory, CacheKeyResolver) }public void idleCallback(IdleResourceCallback idleResourceCallback)
public int activeCallsCount()
GraphQLCall & AppSyncPrefetch objects which are currently in progress.