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

fetchPolicy cache-and-network makes loading get updates on refetch #10167

Open
EvertEt opened this issue Oct 7, 2022 · 5 comments
Open

fetchPolicy cache-and-network makes loading get updates on refetch #10167

EvertEt opened this issue Oct 7, 2022 · 5 comments
Assignees

Comments

@EvertEt
Copy link

EvertEt commented Oct 7, 2022

Intended outcome:
loading should not be updated when calling refetch. Even when using fetchPolicy cache-and-network

Actual outcome:
loading became true again when calling refetch. This is the behaviour without a specified fetchPolicy. (And no notifyOnNetworkStatusChange specified)

How to reproduce the issue:
https://codesandbox.io/s/elastic-dan-r056e3?file=/src/index.jsx:461-498
You can comment the fetchPolicy line and see loading is not shown when refetching.

Versions
See sandbox, started from sandbox template.

@jpvajda
Copy link
Contributor

jpvajda commented Oct 12, 2022

@EvertEt 👋 this problem might be covered in this issue #10105, could you check it out and let us know?

@jpvajda jpvajda added the 🏓 awaiting-contributor-response requires input from a contributor label Oct 12, 2022
@EvertEt
Copy link
Author

EvertEt commented Oct 13, 2022

@jpvajda To me it seems to be a different issue but I am not very experienced with apollo yet.

@jpvajda jpvajda added 🔍 investigate Investigate further and removed 🏓 awaiting-contributor-response requires input from a contributor labels Oct 17, 2022
@EvertEt
Copy link
Author

EvertEt commented Dec 16, 2022

#10105 is closed but the problem persists in last version

@jeel-toddleapp
Copy link

I think current loading behaviour is ideal as we are refetching latest data.

@hankwz
Copy link

hankwz commented Mar 22, 2024

I am seeing the same issue in our app. With no data changed, the component still got updated twice when calling refretch. This is only happening with the cache-and-network fetchPolicy. We are using the Apollo client 3.7.16. The latest 3.9.8 also has this problem.

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

No branches or pull requests

6 participants