InterceptorResponse resolveFromCache(InterceptorRequest request) throws ApolloException { ResponseNormalizer<Record> responseNormalizer = apolloStore.cacheResponseNormalizer(); //noinspection unchecked ApolloStoreOperation<Response> apolloStoreOperation = apolloStore.read(request.operation, responseFieldMapper, responseNormalizer, request.cacheHeaders); Response cachedResponse = apolloStoreOperation.execute(); if (cachedResponse.data() != null) { logger.d("Cache HIT for operation %s", request.operation); return new InterceptorResponse(null, cachedResponse, responseNormalizer.records()); } logger.d("Cache MISS for operation %s", request.operation); throw new ApolloException(String.format("Cache miss for operation %s", request.operation)); }
public <D extends Operation.Data, T, V extends Operation.Variables> GraphQLStoreOperation<T> read( @Nonnull final Operation<D, T, V> operation) { return mStore.read(operation); }
public <F extends GraphqlFragment> GraphQLStoreOperation<F> read( @Nonnull final ResponseFieldMapper<F> responseFieldMapper, @Nonnull final CacheKey cacheKey, @Nonnull final Operation.Variables variables) { return mStore.read(responseFieldMapper, cacheKey, variables); }
public <D extends Operation.Data, T, V extends Operation.Variables> GraphQLStoreOperation<Response<T>> read(@Nonnull final Operation<D, T, V> operation, @Nonnull final ResponseFieldMapper<D> responseFieldMapper, @Nonnull final ResponseNormalizer<Record> responseNormalizer, @Nonnull final CacheHeaders cacheHeaders) { return mStore.read(operation, responseFieldMapper, responseNormalizer, cacheHeaders); }
private InterceptorResponse resolveFromCache(InterceptorRequest request) throws ApolloException { ResponseNormalizer<Record> responseNormalizer = mApolloStore.cacheResponseNormalizer(); //noinspection unchecked GraphQLStoreOperation<Response> graphQLStoreOperation = mApolloStore.read(request.operation, responseFieldMapper, responseNormalizer, request.cacheHeaders); Response cachedResponse = graphQLStoreOperation.execute(); if (cachedResponse.data() != null) { logger.d("Cache HIT for operation %s", request.operation); return new InterceptorResponse(null, cachedResponse, responseNormalizer.records()); } logger.d("Cache MISS for operation %s", request.operation); throw new ApolloException(String.format("Cache miss for operation %s", request.operation)); }
private InterceptorResponse resolveFromCache(InterceptorRequest request) throws ApolloException { ResponseNormalizer<Record> responseNormalizer = mApolloStore.cacheResponseNormalizer(); //noinspection unchecked GraphQLStoreOperation<Response> graphQLStoreOperation = mApolloStore.read(request.operation, responseFieldMapper, responseNormalizer, request.cacheHeaders); Response cachedResponse = graphQLStoreOperation.execute(); if (cachedResponse.data() != null) { logger.d("Cache HIT for operation %s", request.operation); return new InterceptorResponse(null, cachedResponse, responseNormalizer.records()); } logger.d("Cache MISS for operation %s", request.operation); throw new ApolloException(String.format("Cache miss for operation %s", request.operation)); }