Koskamo

Queries, mutations, and query features

Document v1 · published by Koskamo editorial · updated 2026-10-04

Original source

GraphQL supports three operation types — queries, mutations, and subscriptions — and a read operation starts at the query root operation type, then traverses a selection set of fields down to leaf values, which are Scalar or Enum types. The result returns under a top-level data key and mirrors the shape of the query, with any errors on a top-level errors key. Fields can return Object types, so one request can traverse related objects instead of making several roundtrips as in a classic REST architecture, and every field can take its own arguments. Aliases rename a result key so the same field can be fetched twice with different arguments. Dynamic values belong in variables, not string interpolation: replace the static value with $variableName, declare it in the operation (defaults such as $episode: Episode = JEDI are allowed), and pass values in a separate, usually JSON, dictionary. Fragments are reusable selection sets, inline fragments with type conditions reach fields on concrete types behind Interface or Union fields, and __typename reports the Object type at any point. The specification includes exactly two directives, @include(if: Boolean) and @skip(if: Boolean), which any spec-compliant server must support. Scope: GraphQL. Reviewed October 4, 2026.

Source and provenance

Original source
graphql.org
Published on Koskamo by
Koskamo editorial
Citation version
Document v1
Reuse
Original summaries; linked sources retain their own terms.

The original source supplies the underlying information. Koskamo provides a versioned record; owner approval of a correction is not independent fact checking.