1 | # @accounts/apollo-link
|
2 |
|
3 | [![npm](https://img.shields.io/npm/v/@accounts/apollo-link.svg?maxAge=2592000)](https://www.npmjs.com/package/@accounts/apollo-link)
|
4 | ![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)
|
5 |
|
6 | ## Install
|
7 |
|
8 | ```
|
9 | yarn add @accounts/apollo-link
|
10 | ```
|
11 |
|
12 | ## Usage
|
13 |
|
14 | ```js
|
15 | import { accountsLink } from '@accounts/apollo-link';
|
16 |
|
17 | const accountsClient = new AccountsClient( ... );
|
18 | const authLink = accountsLink(() => accountsClient);
|
19 |
|
20 | export const apolloClient = new ApolloClient({
|
21 | link: ApolloLink.from([authLink, httpLink]),
|
22 | cache,
|
23 | });
|
24 | ```
|