Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1925 from JamesTheHacker/master
Browse files Browse the repository at this point in the history
Updated README to replace `apollo-client-preset` with `apollo-boost`
  • Loading branch information
hwillson authored Jun 21, 2018
2 parents a9f0d37 + 3ff6c71 commit c470c4b
Show file tree
Hide file tree
Showing 4 changed files with 2,027 additions and 2,119 deletions.
5 changes: 5 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change log

## vNext (June X, 2018)

- README updates to replace `apollo-client-preset` with `apollo-boost`.
- [@JamesTheHacker](https://github.com/JamesTheHacker) in [#1925](https://github.com/apollographql/react-apollo/pull/1925)

## 2.1.6 (June 19, 2018)

- Adjust `getDataFromTree` to properly traverse React 16.3's context API
Expand Down
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,18 @@ Get started today on the app you’ve been dreaming of, and let React Apollo tak

## Installation

It is simple to install React Apollo and related libraries.
It is simple to install React Apollo and related libraries

```bash
# installing the preset package (apollo-boost) and react integration
npm install apollo-boost react-apollo graphql-tag graphql --save

# installing each piece independently
npm install apollo-client apollo-cache-inmemory apollo-link-http react-apollo graphql-tag graphql ---save
npm install apollo-client apollo-cache-inmemory apollo-link-http react-apollo graphql-tag graphql --save
```

[apollo-boost](https://github.com/apollographql/apollo-client/tree/master/packages/apollo-boost) is a minimal config way to start using Apollo Client. It includes some sensible defaults, such as `InMemoryCache` and `HttpLink`.

That’s it! You may now use React Apollo in any of your React environments.

For an amazing developer experience you may also install the [Apollo Client Developer tools for Chrome][] which will give you inspectability into your React Apollo data.
Expand Down Expand Up @@ -61,6 +63,14 @@ const client = new ApolloClient({
});
```

If you're using [apollo-boost](https://github.com/apollographql/apollo-client/tree/master/packages/apollo-boost), you can create an `ApolloClient` that uses `HttpLink` and `InMemoryCache` like so:

```js
import { ApolloClient } from 'apollo-boost';

const client = new ApolloClient();
```

> Migrating from 1.x? See the [2.0 migration guide](https://www.apollographql.com/docs/react/2.0-migration.html).
Next you will want to add a [`<ApolloProvider/>`][] component to the root of your React component tree. This component [provides](https://reactjs.org/docs/context.html) the React Apollo functionality to all the other components in the application without passing it explicitly. To use an [`<ApolloProvider/>`][] with your newly constructed client see the following:
Expand Down
Loading

0 comments on commit c470c4b

Please sign in to comment.