apollo-link-log
v1.1.3
Published
Log side effect for Apollo Link.
Downloads
66
Readme
apollo-link-log
Log side effect for Apollo Link.
Installation
$ yarn add apollo-link-log apollo-link graphql
Usage
import createLogLink from 'apollo-link-log';
// Default
ApolloLink.concat(createLogLink());
// With options
ApolloLink.concat(createLogLink({
enabled: process.env.NODE_ENV !== 'production',
logger: ({ operation, operationName, query, variables }) => {...};
}));
Snapshot
Options
type Options = {
enabled?: boolean,
logger?: (params: {
operation: Object,
operationName: ?string,
query: string,
variables: Object,
}) => void,
};
Inspiration
- https://github.com/blackxored/apollo-link-logger
Development
Requirements
- node >= 11.9.0
- yarn >= 1.13.0
- apollo-link ^1.0.0
- graphql ^14.0.0
$ yarn install --pure-lockfile
$ yarn start
Test
$ yarn run format
$ yarn run eslint
$ yarn run flow
$ yarn run test:watch
$ yarn run build
Publish
$ npm version patch
$ npm run changelog
git commit & push
CONTRIBUTING
- ⇄ Pull requests and ★ Stars are always welcome.
- For bugs and feature requests, please create an issue.
- Pull requests must be accompanied by passing automated tests.