Access our course library with 40% off
So far in our example app, we have only been fetching data from our GraphQL API endpoint. In this lesson, we’ll learn how to modify data on our server using GraphQL.
In a REST API, we typically use GET requests to fetch something, and POST / PUT / PATCH / UPDATE requests to change data on the server.
In GraphQL, however, the distinction is a bit simpler:
querywhen we need to fetch data
mutationwhen we need to modify anything
Let’s explore how to edit a book’s information, and look at how this affects the Apollo cache and how the changes are reflected in our Vue app.