@freewall/apollo-console-logger
v0.3.0
Published
[![npm version](https://img.shields.io/npm/v/@freewall/apollo-console-logger?color=blue)](https://www.npmjs.com/@freewall/apollo-console-logger) [![publish status](https://img.shields.io/github/actions/workflow/status/FreeWall/apollo-console-logger/publis
Downloads
38
Maintainers
Readme
Apollo Console Logger
A console logger link for Apollo Client. Logs request and response of queries and mutations to console.
Installation
npm install @freewall/apollo-console-logger
Usage
import { ConsoleLoggerLink } from '@freewall/apollo-console-logger';
const link = ApolloLink.from([
new ConsoleLoggerLink(),
new HttpLink({
uri: '...',
}),
]);
const client = new ApolloClient({
link,
// ...
});
Options
// default values:
new ConsoleLoggerLink({
colors: {
query: {
request: '#E17E00',
response: '#A65D00',
},
mutation: {
request: '#E10098',
response: '#A5006F',
},
},
multiline: false,
responseSize: true,
responseTime: true,
});