Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@wora/apollo-cache

morrys840MIT2.3.1TypeScript support: included

@wora Apollo Cache

cache, wora, cache-persist, inmemory, apollo

readme

@wora/apollo-cache

Installation

Install @wora/apollo-cache using yarn or npm:

yarn add @wora/apollo-cache

Examples

import ApolloCache from '@wora/apollo-cache';

const cache = new ApolloCache({...});

// await before instantiating ApolloClient, else queries might run before the cache is persisted
await cache.hydrated();

// Continue setting up Apollo as usual.

const client = new ApolloClient({
  cache,
  ...
});

Options

  • constructor(options?: InMemoryCacheConfig, persistOptions?:CacheOptions);

CacheOptions