What is incremental delivery in GraphQL with @defer and @stream?
Answer
Incremental delivery is a GraphQL feature that allows the server to send parts of a response progressively as they become ready, rather than waiting for the entire response. The @defer directive marks a fragment that can be delivered later: { user { name ... on User @defer { expensiveComputedField } } }. The client receives an initial response with the non-deferred fields immediately, then receives patches for deferred fragments over a multipart HTTP response. @stream applies to list fields, streaming list items as they are resolved. This dramatically improves perceived performance — users see critical data (like a page title) instantly while slower data loads in the background. Both are part of the GraphQL 2022 specification and require server and client support (Apollo Server 4+ and Apollo Client 3.7+).
Previous
What is Apollo Federation and how do subgraphs, gateways, and directives like @key and @extends work?
Next
How do you implement query cost analysis and rate limiting in a production GraphQL API?
More GraphQL Questions
View all →- Advanced What is Apollo Federation and how do subgraphs, gateways, and directives like @key and @extends work?
- Advanced How do you implement query cost analysis and rate limiting in a production GraphQL API?
- Advanced What is schema evolution and deprecation strategy in GraphQL?
- Advanced What is the Relay specification for GraphQL — Node interface, Connection/Edge pagination?
- Advanced How do you implement distributed tracing across GraphQL resolvers?