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
startPolling updates cache and UI only once after using writeQuery. After that, even if totally fresh data is incoming, cache is not touched at all, UI is never updated.
Apollo Client version 3.7.9.
Link to Reproduction
Described in reproduction steps
Reproduction Steps
exportconstQUERY=gql` someThing(id: $id) { __typename id state { __typename someNumber } }`
When the view loads, it calls the query for the first time. All data loads fine.
If I press Button 1 to write query, cache is updated fine, UI is refreshed fine.
If I press Button 2 to write query, cache is updated fine, UI is refreshed fine.
I can click Button 1 and Button 2 as many time as I want and the cache and UI are both updated all the time.
If I press Button 3 to start polling, it updates cache and UI, then I press either Button 1 or Button 2, this updates cache and UI, the polling continues but it updates nothing after that - neither cache nor UI. Note that the call to server always returns random state.someNumber, so the data is always new.
I can reproduce the above all the time. So, steps are:
Load query on view load
Write to cache with writeQuery
Start polling
Polling updates cache and UI
Write to cache with writeQuery again
Polling does not update anything (I can see from network that requests are done and data has a new value every time)
I also have basic InMemoryCache for logging. Otherwise, the logic is just using mergeObjects, but it doesn't matter - as it's called only once (first poll result after writeQuery, after that it doesn't even call it).
What works:
Load query on view load
Start polling
Polling updates cache and UI
Polling keeps updating cache and UI, as data is always different
Basically, without using writeQuery, polling works as expected.
The text was updated successfully, but these errors were encountered:
Hi @NeverwinterMoon 👋🏻 thanks for opening this issue! @phryneas is working on a branch that may address this issue. Thanks for your patience while we prove this out 🙏🏻
Issue Description
startPolling
updates cache and UI only once after usingwriteQuery
. After that, even if totally fresh data is incoming, cache is not touched at all, UI is never updated.Apollo Client version 3.7.9.
Link to Reproduction
Described in reproduction steps
Reproduction Steps
When the view loads, it calls the query for the first time. All data loads fine.
If I press
Button 1
to write query, cache is updated fine, UI is refreshed fine.If I press
Button 2
to write query, cache is updated fine, UI is refreshed fine.I can click
Button 1
andButton 2
as many time as I want and the cache and UI are both updated all the time.If I press
Button 3
to start polling, it updates cache and UI, then I press eitherButton 1
orButton 2
, this updates cache and UI, the polling continues but it updates nothing after that - neither cache nor UI. Note that the call to server always returns randomstate.someNumber
, so the data is always new.I can reproduce the above all the time. So, steps are:
writeQuery
writeQuery
againI also have basic
InMemoryCache
for logging. Otherwise, the logic is just usingmergeObjects
, but it doesn't matter - as it's called only once (first poll result afterwriteQuery
, after that it doesn't even call it).What works:
Basically, without using
writeQuery
, polling works as expected.The text was updated successfully, but these errors were encountered: