Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/egorlem/apollo-link-printer
Pretty logger of Apollo GraphQL network operations
https://github.com/egorlem/apollo-link-printer
apollo apollo-client apollo-link apollographql graphql
Last synced: 21 days ago
JSON representation
Pretty logger of Apollo GraphQL network operations
- Host: GitHub
- URL: https://github.com/egorlem/apollo-link-printer
- Owner: egorlem
- License: mit
- Created: 2024-09-02T08:58:09.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-09-30T15:44:40.000Z (about 1 month ago)
- Last Synced: 2024-10-01T04:40:54.305Z (about 1 month ago)
- Topics: apollo, apollo-client, apollo-link, apollographql, graphql
- Language: TypeScript
- Homepage:
- Size: 747 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Apollo link Printer
**Pretty logger of Apollo GraphQL network operations**
![NPM Version](https://img.shields.io/npm/v/apollo-link-printer) ![NPM License](https://img.shields.io/npm/l/apollo-link-printer)
---
![Preview](https://raw.githubusercontent.com/egorlem/apollo-link-printer/main/doc/preview.d.png)
---
### Installation
Node Package Manager installation
```bash
npm install apollo-link-printer
```
Yarn installation
```bash
yarn add apollo-link-printer
```
---### Usage
```js
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(),
});
```
---
### Options| 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``` |---
### Contributing
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:
```bash
npm install # or `yarn`
```
To run the library locally in another project, you can do the following:```bash
npm link# in the project you want to run this in
npm link apollo-link-printer
```
---License [MIT](https://github.com/egorlem/apollo-link-printer/blob/8d706dceb29d9c5ef85b5cd315efefcb4d924d48/LICENSE.md) © [Egor Lem](https://egorlem.com/)