
com.apollographql.apollo.internal.cache.normalized.NoOpApolloStore Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws-android-sdk-appsync-runtime Show documentation
Show all versions of aws-android-sdk-appsync-runtime Show documentation
AWS AppSync GraphQL runtime library to support generated code
/**
* Copyright 2018-2019 Amazon.com,
* Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
package com.apollographql.apollo.internal.cache.normalized;
import com.apollographql.apollo.api.GraphqlFragment;
import com.apollographql.apollo.api.Operation;
import com.apollographql.apollo.api.Response;
import com.apollographql.apollo.api.ResponseFieldMapper;
import com.apollographql.apollo.cache.CacheHeaders;
import com.apollographql.apollo.cache.normalized.ApolloStore;
import com.apollographql.apollo.cache.normalized.GraphQLStoreOperation;
import com.apollographql.apollo.cache.normalized.CacheKey;
import com.apollographql.apollo.cache.normalized.CacheKeyResolver;
import com.apollographql.apollo.cache.normalized.NormalizedCache;
import com.apollographql.apollo.cache.normalized.Record;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
/**
* An alternative to {@link RealAppSyncStore} for when a no-operation cache is needed.
*/
public final class NoOpApolloStore implements ApolloStore, ReadableStore, WriteableStore {
@Override public Set merge(@Nonnull Collection recordCollection, @Nonnull CacheHeaders cacheHeaders) {
return Collections.emptySet();
}
@Override public Set merge(Record record, @Nonnull CacheHeaders cacheHeaders) {
return Collections.emptySet();
}
@Nullable @Override public Record read(@Nonnull String key, @Nonnull CacheHeaders cacheHeaders) {
return null;
}
@Override public Collection read(@Nonnull Collection keys, @Nonnull CacheHeaders cacheHeaders) {
return Collections.emptySet();
}
@Override public void subscribe(RecordChangeSubscriber subscriber) {
}
@Override public void unsubscribe(RecordChangeSubscriber subscriber) {
}
@Override public void publish(Set keys) {
}
@Nonnull @Override public GraphQLStoreOperation clearAll() {
return GraphQLStoreOperation.emptyOperation(Boolean.FALSE);
}
@Nonnull @Override public GraphQLStoreOperation remove(@Nonnull CacheKey cacheKey) {
return GraphQLStoreOperation.emptyOperation(Boolean.FALSE);
}
@Nonnull @Override public GraphQLStoreOperation remove(@Nonnull List cacheKeys) {
return GraphQLStoreOperation.emptyOperation(0);
}
@Override public ResponseNormalizer
© 2015 - 2025 Weber Informatics LLC | Privacy Policy