GraphQL has three operation types: query for reading, mutation for writing, and subscription for real-time updates. Each starts at its own root type in the schema, Query, Mutation or Subscription, whose fields are that operation's entry points.
A query reads data. The server can resolve its fields in parallel.
A mutation writes data. Its top-level fields run one after another, so two writes in one request never race.
A subscription keeps a long-lived request open, and the server pushes new data each time an event happens.
query GetUser {
user(id: "123") { name }
}
mutation CreateUser {
createUser(input: { name: "John" }) {
name
}
}
subscription UserUpdates {
userUpdated(id: "123") {
name
}
}
Rewriting in plainer words…
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.