Query Now, Render Later: Leveraging @defer for Efficient Data Delivery
summary
@defer lets a client mark an inline fragment to be deprioritized so an initial JSON chunk returns fast and slower fields arrive later via an HTTP multipart/mixed stream using a boundary like "graphql" the transport parses readable streams and emits chunks with next:true/false so regions render immediately while Pokemon stats and abilities stream in later Apollo Router and Apollo Client 3.7 already support this RFC stage 2 feature and a new DevTools network tab is being built to inspect per‑chunk messages in real time
AI-written summary · about
chapters (10)
- 0:00Introduction
- 0:51Brief History
- 2:52What is defer
- 4:45The problem with defer
- 5:04A harrowing tale
- 13:05The underlying delivery mechanism
- 14:13Accept header
- 16:02Rough response
- 17:00Content type
- 22:47Conclusion
related talks
13m@Defer All the Slow Things
21mStreaming HTTP and GraphQL
32mLower Latency With Streaming GraphQL
12mImprove Application Performance and User Engagement with Advanced GraphQL Features
35mState of @Defer and @Stream
12mHow @Defer and @Stream Will Improve GraphQL Caching
25mWhat's next for GraphQL?
16mStreaming Server Side Rendering simplified with Next.JS
