How to do it...

Now that we have our backend ready, let's start working on our frontend:

  1. The first file we need to modify is the index.js file:
    // Dependencies    import React from 'react';    import { render } from 'react-dom';    import ApolloClient from 'apollo-boost';    import { ApolloProvider } from 'react-apollo';    // Components    import App from './App';    // Styles    import './index.css';    // Apollo Client    const client = new ApolloClient({      uri: 'http://localhost:5000/graphiql' // Backend endpoint    });    // Wrapping the App with ApolloProvider    const AppContainer = () => (      <ApolloProvider client={client}>        <App />      </ApolloProvider>    );    // Root    const root = document.getElementById('root');    // Rendering the AppContainer    render(<AppContainer />, root); ...

Get React Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.