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

Query widget should rebuild if cache changes from other Query #587

Closed
christian-muertz opened this issue Mar 21, 2020 · 3 comments
Closed
Labels
enhancement New feature or request

Comments

@christian-muertz
Copy link

Is your feature request related to a problem? Please describe.
If i have two different widgets showing the same query or a slightly different one, i want to keep them in sync showing the same information. When one query for example refreshes I want the second one to show the new information as well.

Describe the solution you'd like
I would like the Query widget to rebuild when new information represented by this query is available in the cache.

Additional context
First of all i am quite new to graphql clients and for sure i am just implementing something wrong.
I understand the concept of normalization and for me it would make sense if a normalized entity in the cache changes that all queries that contain that entity rebuild their subtree with the new information available in the cache?!

This apollo page states the following:

The GraphQL query itself is still only sent once, but the watchQuery observable can also update if, for example, another query causes the object to be updated within Apollo Client's global cache.

@christian-muertz
Copy link
Author

Ok I found out that QueryManager has a function called rebroadcastQueries which updates all query streams with data from the cache. This function is only called after mutations but should be called whenever a query result from the network comes in!

@micimize micimize added the enhancement New feature or request label May 9, 2020
@micimize
Copy link
Collaborator

micimize commented May 9, 2020

Using rxdart like ferry does to create true observables might fix this

@micimize
Copy link
Collaborator

Consolidating into #728

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants