InterviewBuddy
All interview questions

How do GraphQL queries and mutations differ?

Beginner

Answer

Queries request data. Mutations represent operations that change state; their top-level fields execute serially within one operation.

Explanation

Serial mutation execution does not automatically create a database transaction.

Example

query { viewer { id } } versus mutation { updateName(name: "Ada") { id } }