Apollo Cache Logger
Installation
npm install --save-dev apollo-cache-logger
Usage
import LogCache from 'apollo-cache-logger';
const cache = new LogCache(new InMemoryCache(), { logger: msg => console.log(msg) });
Sample output:
read(query CounterState {
counterState @client {
counter
}
}) -> {"counterState":{"counter":1,"__typename":"CounterState"}}
diff(query CounterState {
counterState @client {
counter
__typename
}
}) -> {"result":{"counterState":{"counter":1,"__typename":"CounterState"}},"complete":true}
read(query counterQuery {
counter {
amount
}
}) -> {"counter":{"amount":19,"__typename":"Counter"}}
License
Copyright © 2018 SysGears LTD. This source code is licensed under the MIT license.