GraphQL Cheat Sheet
|
This section documents the current GraphQL specification (October 2021), plus the working draft for
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.
The query language — Queries and Fields, Variables, Directives & Fragments, Mutations, Subscriptions, and Introspection.
Designing the schema — Schema and Type System, Interfaces, Unions & Inputs, Directives, and GraphQL Schema Design.
Execution & operating a server — Execution & Resolvers, Validation, Response and Error Handling, Serving GraphQL over HTTP, Pagination, Global Object Identification, GraphQL Caching, Performance & N+1, Security and Demand Control, Authorization, and Federation.
Spring Boot integration — Spring Boot: Getting Started with GraphQL, Spring Boot: Annotated Controllers, Spring Boot: Data Loading & Integration, and Spring for GraphQL: Transports, Security, and Testing.
Python integration — Python: Getting Started, Strawberry with FastAPI, Strawberry — Schema and Features, and Ariadne: Schema-First GraphQL.
Configuring clients — GraphQL Clients: Choosing an Approach, Apollo Client Configuration, and Other GraphQL Clients: urql, Relay, JVM, and Python.