First of all, you need to install a few dependencies:
- Go to the frontend folder.
- Execute this command: yarn add apollo apollo-client apollo-boost react-apollo graphql.
Here is why we need each of these:
- apollo: This package includes the Apollo CLI (among other things), which we will use to generate client-side code for GraphQL queries, based on the server-side GraphQL schema and validated against it. This process will ensure that our queries are valid (that is, match the server-side schema) and that we have type safety and auto-completion.
- apollo-client: This contains the base required to create an Apollo Client and interact with the backend server.
- apollo-boost: This contains utilities to start using ...