12
Interfacing with GraphQL on the Frontend Using Apollo Client
After successfully implementing a GraphQL backend using Apollo Server in the previous chapter, we are now going to interface with our new GraphQL API on the frontend using Apollo Client. Apollo Client is a library that makes it easier and more convenient to interact with GraphQL APIs. We’ll start by replacing the fetching of the post list with GraphQL queries, then resolve the author usernames without needing extra queries, showing the power of GraphQL. Next, we’ll add variables to the query to allow setting filters and sorting options. Finally, we’ll learn how to use mutations on the frontend.
In this chapter, we are going to cover the following main topics:
- Setting up Apollo ...
Get Modern Full-Stack React Projects now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.