Simple persistence for all Apollo Client 2.x cache implementations, including InMemoryCache and Hermes. Version 0.1.1 (GitHub: apollographql/apollo-cache-persist). Supports web (localStorage) and React Native (AsyncStorage). Released with no major updates since initial version. Key differentiators: hooks into Apollo cache writes with debounce, supports custom triggers (background, write, custom function), provides a CachePersistor class for manual control. Does not support Apollo Client 3.x (use apollo3-cache-persist for that).
npm install apollo-cache-persistNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows the basics of persisting an Apollo InMemoryCache to localStorage with apollo-cache-persist.
If using Apollo Client 3+, migrate to apollo3-cache-persist.
Update to Apollo Client 3 and use apollo3-cache-persist.
Set maxSize: false for unlimited, or increase as needed.
Use 'write' or custom trigger for web.
Set serialize: false if using a storage provider that handles serialization.
Ensure storage matches the expected interface: getItem, setItem, removeItem.
Pass a valid Apollo Cache instance as the 'cache' option.
Install with 'npm install apollo-cache-persist' and ensure tsconfig has 'node' moduleResolution.
Increase maxSize or set to false for unlimited size.
No dependency data recorded yet.