Skip to content

Commit

Permalink
chore(docs): update docs/rest.md quick start instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
alessbell committed Oct 24, 2022
1 parent 88d7832 commit caf6800
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions docs/rest.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,10 @@ You can start using ApolloClient in your app today, let's see how!

## Quick start

To get started, you need first to install apollo-client:
To get started, you need first to install @apollo/client:

```bash
npm install --save apollo-client
```

For an apollo client to work, you need a link and a cache, [more info here](https://www.apollographql.com/docs/react/basics/setup/#installation). Let's install the default in memory cache:

```bash
npm install --save apollo-cache-inmemory
npm install --save @apollo/client
```

Then it is time to install our link and its `peerDependencies`:
Expand All @@ -37,8 +31,7 @@ npm install --save apollo-link-rest apollo-link graphql qs
After this, you are ready to setup your apollo client:

```js
import { ApolloClient } from 'apollo-client';
import { InMemoryCache } from 'apollo-cache-inmemory';
import { ApolloClient, InMemoryCache } from '@apollo/client';
import { RestLink } from 'apollo-link-rest';

// setup your `RestLink` with your endpoint
Expand All @@ -51,6 +44,10 @@ const client = new ApolloClient({
});
```

From the [Apollo Client "Get started" docs](https://www.apollographql.com/docs/react/get-started#step-3-initialize-apolloclient):

> `cache` is an instance of `InMemoryCache`, which Apollo Client uses to cache query results after fetching them.
Now it is time to write our first query, for this you need to install the `graphql-tag` package:

```bash
Expand Down

0 comments on commit caf6800

Please sign in to comment.