Pretty logger of Apollo GraphQL network operations
Node Package Manager installation
npm install apollo-link-printer
Yarn installation
yarn add apollo-link-printer
import { PrinterLink } from 'apollo-link-printer';
// See options
const options = {
print: true,
}
const client = new ApolloClient({
link: ApolloLink.from([
new PrinterLink(options),
new HttpLink({ uri: 'http://localhost:4000' }),
]),
cache: new InMemoryCache(),
});
name | type | explanation |
---|---|---|
print |
boolean | if true , information will be output to the console |
collapsed |
boolean | if true , console.groupCollapsed will be used, otherwise console.group |
This project uses TypeScript to bring static types to JavaScript and uses Jest for testing. To get started, clone the repo and run the following commands:
npm install # or `yarn`
To run the library locally in another project, you can do the following:
npm link
# in the project you want to run this in
npm link apollo-link-printer