GraphQL Caching of Queries with Apollo Client in React

In this lesson, you will implement the Organization Component and learn how to cache queries using GraphQL with Apollo Client in React.

In this lesson, we will introduce React Router to show two separate pages for your application. At the moment, we are only showing one page with a Profile component that displays all your repositories. We want to add another Organization component that shows repositories by an organization, and there could be a search field as well, to look up individual organizations with their repositories on that page. Let’s do this by introducing React Router to our application. If you haven’t used React Router before, make sure to conduct the exercises of this lesson to learn more about it.

In your src/constants/routes.js file, you can specify both routes you want to make accessible by React Router. The ORGANIZATION route points to the base URL, while the PROFILE route points to a more specific URL.

Get hands-on with 1200+ tech skills courses.