Description
Describe the bug
Using fetchMore
and then refetch
causes duplicated results.
To Reproduce
Steps to reproduce the behavior:
- Load results from backend using
useQuery
- Use
fetchMore
to load the next page - Perform a search on the results using
refetch
- You must only trigger
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 bug - You must produce this bug on the first
refetch
you perform, any followingrefetch
calls will not reproduce the bug - The bug will only be reproducible on the first time you do it, to reproduce it again you have to reload
- The found item does not have to be in memory, reproducible either way
- You must only trigger
What 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 Ref result
from useQuery
you will notice how result
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 watching result
from useQuery
is still triggered twice with the correct and then incorrect value).