apollographql / apollo-feature-requests

🧑‍🚀 Apollo Client Feature Requests | (no 🐛 please).
Other
130 stars 7 forks source link

Incrementally render results when using `@defer` with `client.mutate` #394

Open alessbell opened 1 year ago

alessbell commented 1 year ago

See original comment here.

When @defer support was originally added to Apollo Client's client.mutate API via https://github.com/apollographql/apollo-client/pull/10368, the existing design (returning a Promise that resolves with a single value) prevented incremental chunks from being rendered as they're delivered.

Instead, the result is assembled and resolved after the final chunk is delivered, effectively erasing the benefit of @defer.

This is a feature request for a client.mutate API which allows multipart responses to be consumed as each multipart chunk arrives.