January 2019
Intermediate to advanced
460 pages
10h 33m
English
We have tested Apollo Client, and have confirmed that it works. However, React does not yet have access to it. Since Apollo Client is going to be used everywhere in our application, we can set it up in our root index.js file, as follows:
import React from 'react';import ReactDOM from 'react-dom';import { ApolloProvider } from 'react-apollo';import App from './App';import client from './apollo';ReactDOM.render( <ApolloProvider client={client}> <App /> </ApolloProvider>, document.getElementById('root'));
As we mentioned in Chapter 1, Preparing Your Development Environment, you should only edit this file when the whole application needs access to the new component. In the preceding code, you can see that we ...
Read now
Unlock full access