Apollo Cache Logger is a debugging utility for Apollo Client that wraps any Apollo cache implementation (e.g., InMemoryCache) and logs all cache read and diff operations. Version 1.1.1 is the latest stable release; the package has seen no updates since 2018 (low release cadence). It intercepts cache calls and prints the query along with the cache result, aiding in GraphQL cache debugging. Key differentiator: lightweight, zero-config logging that works with any Apollo cache without modifying existing code.
npm install apollo-cache-loggerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to import LogCache and wrap an InMemoryCache with a custom logger function.
Switch to Apollo Client DevTools or use a custom Apollo link for logging in newer versions.
Use ESM import or CJS require with .default.
Omitting logger defaults to console.log, no error.
Install with --save-dev, but ensure apollo-cache and graphql are in dependencies.
import LogCache from 'apollo-cache-logger' (ESM) or const LogCache = require('apollo-cache-logger').default (CJS)npm install apollo-cache graphql
new LogCache(new InMemoryCache(), ...)