You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Intended outcome:
With a link which ResultObservable emits more than 1 result, I was expecting the watchQuery to emit more than 1 value.
Actual outcome:
The resultObservable is unsubscribed directly after the first result and the watchQuery emits only the first value.
However, use the option queryDeduplication=false fixes the issue. So I guess the issue is more in the apollo-link-dedup.
How to reproduce the issue:
const{ ApolloClient }=require('apollo-client');const{ InMemoryCache }=require('apollo-cache-inmemory');const{ ApolloLink, Observable }=require('apollo-link');constgql=require('graphql-tag');// used to mock a Link that returns a streaming observableclassMockSubscriptionLinkextendsApolloLink{request(){returnnewObservable(observer=>{this.observer=observer;return()=>{console.log('unsubscribe')}})}simulateResult(result){const{ observer }=this;observer.next(result);}}constlink=newMockSubscriptionLink();constclient=newApolloClient({link: link,cache: newInMemoryCache(),// queryDeduplication: false,});constquery=gql` query { a }`;client.watchQuery({ query }).subscribe(res=>console.log('watchQuery.next',res));setTimeout(()=>{link.simulateResult({data : {a: 1}})},1000);setTimeout(()=>{link.simulateResult({data: {a: 3}})},2000);
Sorry for the delay. Can you try the latest beta of apollo-client, 2.6.0-beta.8? We replaced the internal use of apollo-link-dedup with a new implementation in 7cd8479, and I'm hoping this bug got fixed in the process.
Closing since we just published the final version of apollo-client@2.6.0 to npm, including the fix for this issue! See CHANGELOG.md if you're curious about the other changes in this release.
Intended outcome:
With a link which
ResultObservable
emits more than 1 result, I was expecting thewatchQuery
to emit more than 1 value.Actual outcome:
The
resultObservable
is unsubscribed directly after the first result and thewatchQuery
emits only the first value.However, use the option
queryDeduplication=false
fixes the issue. So I guess the issue is more in theapollo-link-dedup
.How to reproduce the issue:
With the option
queryDeduplication=false
, here is my expected result:Versions
The text was updated successfully, but these errors were encountered: