GraphQL Cheat Sheet

This section documents the current GraphQL specification (October 2021), plus the working draft for @defer/@stream/@oneOf, and the GraphQL-over-HTTP specification, as published at graphql.org and spec.graphql.org — which are the references these pages are written and verified against — and, for the integration pages, against Spring for GraphQL (2.0.x), Strawberry, Ariadne, and the client docs for Apollo Client / urql / Relay. No specific patch version is pinned. Some surfaces (Apollo Router/managed federation, graphql-ws internals, the Relay compiler internals, GraalVM native) are linked rather than documented in depth.

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production, as GraphQL tooling iterates quickly.

A single-page, colour-coded summary of the GraphQL essentials — the query / mutation / subscription request shape and the data / errors response envelope, the SDL building blocks (object, scalar and enum types, the ! non-null and [] list modifiers, interfaces, unions and input types), the execution model (a resolver’s (parent, args, context, info) signature, parallel field resolution for queries vs. serial execution for mutations, and null propagation up to the nearest nullable ancestor), serving a schema over HTTP (the POST JSON body shape, content negotiation, and which errors get a non-200 status code), the Relay Cursor Connections shape (edges wrapping node and cursor, plus pageInfo), the N+1 problem and its DataLoader batching fix, the security and demand-control checklist (depth limiting, query complexity scoring, timeouts and trusted documents), the Spring for GraphQL essentials (annotated controller mappings and spring.graphql.* properties), the Strawberry / FastAPI essentials (the ASGI router, a context getter, and DataLoader), and the client essentials (Apollo Client’s normalized cache and link chain, urql exchanges, and the JVM GraphQlClient) — handy for quick memorization or as a printable desk reference.

For the full explanation, every option, and additional examples, see the dedicated pages:

Getting started — Getting Started with GraphQL.