
GraphQL Response Streaming with Amazon API Gateway and GraphQL Yoga
Imagine you're building a GraphQL API that returns a list of products where each product requires data from multiple services or expensive calculations. Without response streaming, your users wait until all products are fully processed. With the @stream directive, products are sent to the client as soon as they're ready, improving perceived performance. Until recently, GraphQL response streaming with AWS Lambda was only possible using Lambda Function URLs . But AWS now supports response streaming with Amazon API Gateway , and graphql-yoga has added support for this feature. This opens up new possibilities for building responsive GraphQL APIs with the full feature set of API Gateway (custom domains, usage plans, API keys, etc.). What's new? AWS announced support for response streaming in API Gateway in their blog post Building responsive APIs with Amazon API Gateway response streaming . Instead of buffering the entire Lambda response, API Gateway now streams chunks of data directly to t
Continue reading on Dev.to
Opens in a new tab
