Open seeden opened 6 years ago
As i see it closes the regular queries as well after the first response.
If i roll back to apollo-link-dedup@1.0.0
(from 1.0.2
) everything works properly again.
I do not fully understand the logic of dedupLink but the root of the issue is maybe here where it calls observer.complete after the first next() call.
cc @jbaxleyiii
I tried apollo-link-dedup@1.0.0 and it is working for me too.
@seeden that is no good at all! I'll see about writing a failing test, would you be able to help with that?
@jbaxleyiii failing test case is very simple. Use graphql decorator from react-apollo and call subscribeToMore in the componentDidMount when data.loaded is true. You will be automatically unsubscribed when you receive first data from subscription. My example is here https://github.com/apollographql/apollo-client/issues/2581
@jbaxleyiii I'm trying to understand how it works to write a failing test. Can you help me why does it have to complete
all the subscribers (here) when the first piece of data arrives ?
Any update on this, this is effecting apolli-link-ws subscriptions
I am still using version 1.0.0
any update ?
After upgrading all apollo* dependencies to latest version solved the issue (in my case :))
I found that I am automatically unsubscribed when I receive first data with subscribeToMore or subscribe. The problem is in the apollo-link-dedup (https://github.com/apollographql/apollo-link/blob/master/packages/apollo-link-dedup/src/dedupLink.ts#L73)
More info about this issue you can find here: https://github.com/apollographql/apollo-client/issues/2581