Relay mutations are the actions that cause side effects in your systems, because they change the state of some resource that your UI cares about. What's interesting about Relay mutations is that they care about side effects that happen to your data as a result of a change in the state of something. For example, if you change the name of a user, this will certainly impact a screen that displays the user details. But, it could also impact a listing screen that shows several users.
Let's see what a mutation looks like:
const mutation = graphql`
mutation ChangeAgeMutation($input: ChangeAgeInput!) {
changeTodoStatus(input: $input) {
viewer {
users
}
user {
age
}
}
}
`;
This is how Relay is able to determine what might be affected as a side effect of performing this mutation. For example, the user might change, but also the viewer.users collection. You'll see more mutations in action in the following chapter.