Skip to content
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

Reactive variables only update cache when query polling is enabled #7630

Closed
Steven-Ireland opened this issue Jan 29, 2021 · 2 comments
Closed

Comments

@Steven-Ireland
Copy link

Steven-Ireland commented Jan 29, 2021

Intended outcome:

Updating the value of a reactive variable should broadcast the local state change to the cache and update any dependent queries

Actual outcome:

Above behavior only occurs when {pollInterval: XXX} is passed to useQuery, and only after the first poll has been completed

How to reproduce the issue:

I have a codesandbox with the issue: https://codesandbox.io/s/apollo-reactivevars-only-work-with-polling-enabled-kk8b3. List items can be "selected" via click with the selected ids stored in a reactive variable.

In the example I've set pollInterval to 5000, the following things can be observed:

  1. No local state changes apply before the 5000 ms has passed
  2. After the 5000ms, any local state changes are reflected in the query immediately
  3. Removing the poll interval entirely causes local state changes to never update the query

Versions

3.3.7, see codesandbox

@jcreighton jcreighton self-assigned this Feb 1, 2021
@jcreighton jcreighton added 🚧 in-triage Issue currently being triaged 🌹 has-reproduction 🐞 bug 💸 caching and removed 🚧 in-triage Issue currently being triaged labels Feb 1, 2021
@jcreighton
Copy link
Contributor

Looks like this was also reported in #7593.

@jcreighton
Copy link
Contributor

Should be fixed with #7657.

@brainkim brainkim assigned brainkim and unassigned brainkim Jun 22, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants