People commonly call everything that hits your GraphQL API server a “query”. But there are a lot of things mixed in there. What do we call a unit of work we’re asking the server to do? It could be a query, a mutation, or a subscription. The word “request” is pretty coupled to the idea of HTTP and the transport. So let’s start by defining some general concepts:
- GraphQL document: A string written in the GraphQL language that defines one or more operations and fragments.
- Operation: A single query, mutation, or subscription that can be interpreted by a GraphQL execution engine.
What are the different parts of a basic operation? Let’s look at a very simple example of a GraphQL document.
... read the whole story at dev-blog.apollodata.com.