This repository has been archived by the owner on Apr 13, 2023. It is now read-only.
Stale variables when combining pollInterval
, skip
, forceFetch
#374
Labels
This seems similar to #358 (but possibly unrelated).
Here is my situation:
But, if I click the button again, this happens:
Steps to Reproduce
I've isolated this in a reproduction case:
To keep things simple I don't do a mutation, just controlling props with
setTimeout
is sufficient to reproduce. I used a mock network interface that just echoes back an argument.Relevant files:
https://github.com/jbinto/apollo_polling_bug/blob/master/src/index.js
https://github.com/jbinto/apollo_polling_bug/blob/master/src/Foo.js
Buggy Behavior
Somehow,
apollo-client
orreact-apollo
is holding on to old variables and issuing queries based on those, despite the fact the props of thegraphql
HOC have changed.Expected Behavior
I should be able to combine
skip
,forceFetch
, andpollInterval
as such:forceFetch
andpollInterval
are fixed astrue
, and1000
respectively.skip
begins astrue
.skip
to false, by re-rendering with new props (including anid
prop, which is used inoptions.variables
)skip
to true, polling stopsskip
to false, and send a newid
propid
prop I provided tooptions.variables
, not the old oneVersion
The text was updated successfully, but these errors were encountered: