Configure Apollo Client for React and GitHub's GraphQL API
Explore how to configure Apollo Client manually for React applications using GitHub's GraphQL API. Understand the setup of HttpLink and InMemoryCache, manage data efficiently, and implement authorization with personal access tokens for secure API communication.
We'll cover the following...
Let’s set up an Apollo Client instance as we did previously. However, this time we will use Apollo Client directly without the zero-configuration package-Apollo Boost which means that we’ll need to configure the Apollo Client ourselves without any sensible defaults. While it’s best to use a tool with sensible defaults for learning, configuring Apollo ourselves exposes the composable ecosystem of Apollo Client and makes clear on using it for initial setup and advancing the setup later.
Additional Packages Required
Two utility packages are required for two mandatory configurations which are ...