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

replaced apollo-client-preset with apollo-boost #1925

Merged
merged 6 commits into from
Jun 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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