Morrys Repositories

Morrys Repositories

  • Docs
  • GitHub

›caching

wora

  • wora

caching

  • Cache Persist
  • Relay Store
  • Apollo Cache

networking

  • NetInfo
  • Detect Network

offline

  • Offline Architecture
  • Thinking Offline
  • Offline First
  • Relay Offline
  • Apollo Offline

Apollo Cache

This library plans to exploit the full potential of the wora/cache-persist cache using it as ObjectCache of the apollo inmemory cache.

This allows it to be totally integrated with the apollo logics without having to change them.

For a better integration I also opened a issue in the apollo project

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({...});

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

// Continue setting up Apollo as usual.

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

Options

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

CacheOptions

Last updated on 2019-11-2 by morrys
← Relay StoreNetInfo →
  • Installation
    • Examples
    • Options
Morrys Repositories
Docs
about wora
Community
User Showcase
More
GitHubStar
Follow @m0rrys
Facebook Open Source
Copyright © 2021 Lorenzo Di Giacomo