GraphQL

Say what the server will do

A document asks for exactly what it needs and the answer arrives in the same shape. What that cost is a different question, and it has an exact answer: a resolver runs once per parent object, so a query four fields long can be eighty-five trips to the database. This is the whole execution model, drilled.

Modules
6
Drills
13
Build steps
1
Time
~4h

Walk out able to

Read a schema and a document you have never seen and say what comes back, what a failure empties, and how many database queries it costs.

What you drill

01

Schemas and documents

What a type admits, and the rule that refuses a query.

02

Execution and writes

Where a value lands, where a null lands, write order

03

The N+1 count

The exact query count, before and after a loader.

04

Caching and REST

What a client store can answer, and what REST costs.

What you get

Skills that stick

Every project mixes short lessons, focused drills and real build steps, so you finish with working code and the judgement behind it.

You will practise

  • Spelling a document, and what a type admits
  • Response shape, null propagation, writes
  • Counting resolver calls, batched and not
  • Client caching, and REST by the numbers

Afterwards you can

  • Say which values a declared type admits
  • Trace a failure to the position it empties
  • Count the queries a document actually costs
  • Decide what a client store can answer

Modules

Step by step

Each module builds on the last. Read a short lesson, drill it until it's second nature, then put it to work.

  1. 1

    Schema, document, syntax

    ~44 min

    Say what a declared type admits, write a document, and name what refuses one.

    • LessonWhy ask for the shape you want4 min
    • LessonRead a field declaration7 min
    • DrillSay what the type admits8 min
    • LessonRead a document7 min
    • DrillWrite it by hand8 min
    • DrillName the rule that rejected it10 min
  2. 2

    One resolver per field

    ~36 min

    Predict where a value lands, and how far a single failure reaches.

    • LessonFollow one field down the tree7 min
    • LessonWhen one resolver raises8 min
    • DrillPlace the value in the answer9 min
    • DrillFind what the null took with it12 min
  3. 3

    Reads, writes and variables

    ~20 min

    Run a document of writes in order, and say what each variable became.

    • DrillRun the writes in document order11 min
    • DrillCoerce the variables9 min
  4. 4

    Count what it costs

    ~41 min

    Produce the number a document costs, before and after a loader.

    • LessonCount what one query costs9 min
    • LessonWhat a loader changes6 min
    • DrillCount the resolver calls13 min
    • DrillCount them again with a loader13 min
  5. 5

    Caching without URLs

    ~22 min

    Decide whether the client can answer without the network, and what a write changed.

    • DrillDecide what the store can answer12 min
    • DrillSay what the write updated10 min
  6. 6

    Against a resource API

    ~53 min

    Count what a document replaces, run one yourself, then diagnose four cold.

    • DrillCount the requests it replaces9 min
    • DrillCount the fields nobody drew9 min
    • Build stepQuery a real schema yourself15 min
    • LessonDiagnose two failures cold10 min
    • LessonDiagnose two more, cold10 min

Ready when you are.

Work through it at your own pace and pick up right where you left off.