PART 1 · VISUAL CONCEPT 05 OF 05

@defer, @stream & Incremental Delivery

Flush the critical above-the-fold page shell immediately over a single HTTP multipart/mixed stream while slow resolvers and list tails hydrate progressively.

Time to First Paint 45 ms Initial shell flushed
Full Completion 620 ms hasNext: false emitted
Wire Chunks 3 / 3 Frames multipart/mixed (--graphql)
Blocked Time Saved 575 ms (-93%) vs monolithic wait
Interactive Lab 01 · multipart/mixed Waterfall & Progressive Hydration

Drag the Playhead & Watch Chunks Hydrate the Client UI

t = 700 ms · Stream Complete
0 ms 700 ms
multipart/mixed Wire Frame Inspector
Live Progressive Client UI Preview 3 / 3 Hydrated
Interactive Lab 02 · Production Traps

Non-Null (!) Bubbling Trap & Chunk Coalescing (deferBatchWindow)

Trap A · Non-Null (!) Bubbling
Nullable (Safe)
Trap B · Chunk Coalescing (deferBatchWindow)
1 Merged Chunk
3 resolvers: 280, 286, 293 ms
reviews
280 ms
sellerBadge
286 ms
etaEstimate
293 ms
Mental Model · 28 Lines of Pure TypeScript

incrementalExecutor.ts — Async Generator Wire Loop

incrementalExecutor.ts

      

HTTP multipart/mixed Framing

One HTTP response flushes the initial payload first (hasNext: true) and streams --graphql boundary patches until the final chunk sets hasNext: false.

Avoid Unsafe ! Inside @defer

If a non-nullable field fails in a late chunk, GraphQL null-bubbling crosses the fragment boundary and erases the parent object the user is already reading.

@defer Objects vs. @stream Lists

Place @defer on fragments for slow object subtrees (AI summaries, invoices), and @stream(initialCount: N) on lists to paint the first N items immediately.