Streaming HTTP and GraphQL
summary
GraphQL can cut round trips by batching queries but the page still waits on the slowest field; the specific fix shown is the @defer directive paired with a MultiPart HTTP response that sends initial JSON then incremental JSON patches (path + data). Implementation uses ReadableStreams or an XHR fallback to treat responses as an observable, and client libraries must track deferred fields (Apollo alpha offers support, Relay lacks null-vs-loading handling). Code and parser available as fetch-multipart-graphql.
AI-written summary · about
chapters (12)
- 0:00Intro
- 2:40GraphQL
- 4:08GraphQL fields
- 5:58GraphQL subscriptions
- 6:59Optimizing GraphQL
- 11:19Multipart HTTP response
- 12:48GraphQL network layer
- 15:26Apollo Client
- 16:49Relay Client
- 18:39Stream Client
- 19:32Summary
- 19:50References
related talks
13m@Defer All the Slow Things
25mWhat's next for GraphQL?
32mLower Latency With Streaming GraphQL
25mQuery Now, Render Later: Leveraging @defer for Efficient Data Delivery
12mImprove Application Performance and User Engagement with Advanced GraphQL Features
12mHow @Defer and @Stream Will Improve GraphQL Caching
35mState of @Defer and @Stream
32mGraphQL Future
