-
-
Notifications
You must be signed in to change notification settings - Fork 522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v4: Using fetchMore and then refetch causes duplicated results. #1026
Comments
Have the same issue! |
Are you using Apollo Client 3 or 2? |
Versions |
Maybe related to apollographql/apollo-client#6916 |
I think it's not completely related to this bug. Currently, I have also a problem in that my watcher on the result is triggered twice when I use the |
Describe the bug
Using
fetchMore
and thenrefetch
causes duplicated results.To Reproduce
Steps to reproduce the behavior:
useQuery
fetchMore
to load the next pagerefetch
refetch
once, so if you're using a search input you should paste the search query in. Typing a query manually and performing more than 1refetch
will not reproduce the bugrefetch
you perform, any followingrefetch
calls will not reproduce the bugWhat happens
The results found are duplicated from
useQuery
.Expected behaviour
The results should only be what was discovered from the Graph call to the backend that came from your
refetch
call.Versions
vue: 2.6.11
vue-apollo: v4.0.0-alpha.10
apollo-client: 2.6.10
Additional context
During the steps to reproduce, if you
watch
the Refresult
fromuseQuery
you will notice howresult
changes twice. The first instance will be the correct value and the second time it's the incorrect value due to duplicated items.You will also notice that when you perform your
refetch
it will only do one Graph backend call, which is expected. The results returned from the server are the correct results. Only one Graph call is perform but watchingresult
fromuseQuery
is still triggered twice with the correct and then incorrect value).The text was updated successfully, but these errors were encountered: