As we will soon see, the code generation feature of Apollo GraphQL is one of its big advantages. Thanks to this, we will be able to ensure that the queries we write on the client-side are valid. They will be checked against the server-side GraphQL schema. Also, TypeScript interfaces will be generated for the queries and their parameters, allowing us to write type-safe code while interacting with the backend GraphQL API.
We will make our code evolve one step at a time:
- First, we're going to prepare our GraphQL queries.
- Then, we will use the Apollo CLI to generate TypeScript code.
- After that, we will create an Apollo Client inside of the Home page.
- Finally, we will use the client ...