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

[modern] FragmentContainer always firing an query request even if { force: false } #2006

Closed
zetavg opened this issue Aug 1, 2017 · 1 comment

Comments

@zetavg
Copy link
Contributor

zetavg commented Aug 1, 2017

I'm writing a sample TodoMVC app with Relay Modern (you can take it a look at: https://rails-relay-todomvc.herokuapp.com/), and is a bit comfused with the force option on RefetchOptions.

What I expected is while using { force: false }, refetching some data that already exists in the Relay Store, for example, switching the filter to "Active" then back to "All" again, will not make a new query request to the server and the cached data will be showed immediately.

But in the realworld™ app, Relay fires an request to the server everytime when I do a refetch, causing a delay on the UI update. Not sure if I've done something wrong or this is an issue on Relay 😆. The related source code lives at https://github.com/zetavg/RailsRelayTodoMVC/blob/master/app/javascript/packs/todo_app/containers/TodoListItemsWithFilter.js#L24.

@kassens
Copy link
Member

kassens commented Sep 11, 2017

RelayModern has pretty aggressive garbage collection. We should document and improve the public caching mechanism, but some more requests than classic are expected. (This is a tradeoff between showing potentially stale data, memory consumption, code complexity, and network requests)

@kassens kassens closed this as completed Sep 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants