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

ResetStore blocks data.loading when data fetched is the same #1387

Closed
thifranc opened this issue Mar 9, 2017 · 1 comment
Closed

ResetStore blocks data.loading when data fetched is the same #1387

thifranc opened this issue Mar 9, 2017 · 1 comment

Comments

@thifranc
Copy link

thifranc commented Mar 9, 2017

Hi !

I'm currently working on a project where I need to handle different languages.
When a user swap from French to English, I change the graphql URI and i reset my apollo store in order to update my data :

window.__APOLLO_CLIENT__.networkInterface._uri = window.__APOLLO_URL__;
window.__APOLLO_CLIENT__.resetStore();

When the freshly fetched data is different from the old one, there is no problem, my component re-render with the freshly fetched data.
But, if the freshly fetched data is the same as the old one after the "update" fetch, the props.data.loading is left to true, so my component is re-rendering but cannot load this code :

                    <ul>
                        {!this.props.data.loading && this.renderProducts() }
                    </ul>

what I expect
I expect the props.data.loading to be set to false as the data has been fetched
what I have
data.props.loading is set to true (because the freshly fetched data is the same as the old one I think) and then my component cannot re-Render properly
Reproduce the issue
do a resetStore() that would call a graphql route and which would return the same data, and try to render a component when this.props.data.loading is set to false.

@thifranc
Copy link
Author

thifranc commented Mar 9, 2017

I've juste seen that this issue is referencedby #1186 I'll post my comment there

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant