apollographql / apollo-kotlin

:rocket:  A strongly-typed, caching GraphQL client for the JVM, Android, and Kotlin multiplatform.
https://www.apollographql.com/docs/kotlin
MIT License
3.76k stars 654 forks source link

@defer: support in JS HttpEngines #3982

Open BoD opened 2 years ago

BoD commented 2 years ago

When using @defer the expectation is that the deferred parts are surfaced as soon as they arrive.

However the current JS and Apple DefaultHttpEngine implementations buffer the whole response before returning it, making all the parts emitted only after the last one has been received.

BoD commented 2 years ago
jpvajda commented 2 years ago

@martinbonnin I noticed this issue in Todo for @defer Will we make this change as a follow up release?

martinbonnin commented 2 years ago

@jpvajda ideally we'd wait for KTOR to implement the feature before adding it in Apollo Kotlin. If it becomes too much of an issue for us, we could consider contributing the fix there. (the feature being the ability to receive HTTP chunks as they arrive)

jpvajda commented 2 years ago

@martinbonnin sounds good! we can discuss what release to put this in in our sync today.

jpvajda commented 2 years ago

We discussed this today and we'll wait to see the resolution on this dependency https://youtrack.jetbrains.com/issue/KTOR-4274/HttpClient-Streaming-support-in-JS.