6. Using Apollo Client for queries
1m

Code walkthrough

Two top-level folders: client and final (We’ll work out of client, but you can consult the code in final to check your work!)

The pages directory contains the code for each page in the app, as well as the routing logic located in index.js.

The components directory contains all of our presentational React components, which receive data as props and render it out.

Code-along: Configure Apollo Client

Goal: Configure ApolloClient.

  1. Pass in the correct value for uri.

    src/index.js
    const client = new ApolloClient({
    uri: 'https://workshop-catstronauts-api.herokuapp.com/',
    cache: new InMemoryCache()
    });
Previous
Next