What is difference between Mutation and Query?

Technology CommunityCategory: GraphQLWhat is difference between Mutation and Query?
VietMX Staff asked 3 years ago

Technically any GraphQL query could be implemented to cause a data write. But there is a convention that any operations that cause writes should be sent explicitly via a mutation.

Besides the difference in the semantic, there is one important technical difference:

Query fields can be executed in parallel by the GraphQL engine while Mutation top-level fields MUST execute serially according to the spec.