Installing and configuring Apollo Client
We have tested our GraphQL application programming interface (API) multiple times during development. We can now start to implement the data layer of our frontend code. In later chapters, we will focus on other tasks, such as authentication and client-side routing. For now, we will aim to use our GraphQL API with our React app.
To start, we must install the React Apollo Client library. Apollo Client is a GraphQL client that offers excellent integration with React and the ability to easily fetch data from our GraphQL API. Furthermore, it handles actions such as caching and subscriptions, to implement real-time communication with your GraphQL backend. Although Apollo Client is named after the Apollo brand, it is not tied to Apollo Server. You can use Apollo Client with any GraphQL API or schema out there, as long as they follow the protocol standards. You will soon see how perfectly the client merges with our React setup.
As always, there...