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

Bug - use query is repeatly called when init component #6358

Closed
unutoiul opened this issue May 29, 2020 · 6 comments
Closed

Bug - use query is repeatly called when init component #6358

unutoiul opened this issue May 29, 2020 · 6 comments

Comments

@unutoiul
Copy link

unutoiul commented May 29, 2020

I've attached here the bug I am using

 "@apollo/client": "^3.0.0-beta.50"

Screenshot 2020-05-29 at 14 49 18

Screenshot 2020-05-29 at 14 50 49

@bengal75
Copy link

I am also running into this, using 3.0.0-beta.53. It happens immediately when using useQuery, but also happens once the query function has been called when using useLazyQuery. I've gone back to 3.0.0-beta.45 for now which doesn't seem to have the issue.

@unutoiul
Copy link
Author

unutoiul commented May 31, 2020

I just notice the issue.. the loader inside the component does the reloading all the time... very weird why I’m not sure what’s the reason

@unutoiul
Copy link
Author

unutoiul commented Jun 1, 2020

the issue is when you setup

defaultOptions: {
        watchQuery: {
            fetchPolicy: 'network-only',
        },
    },

the version . "@apollo/client": "^3.0.0-beta.50" doesn't trigger onCompleted function anymore..

ANY Idea was is BROKEN?

is breaking all my project can Apollo CLIENT TEAM FIX THOSE ISSUES ?

@riccoski
Copy link

riccoski commented Jun 4, 2020

I also get this with "network-only" and "no-cache" fetch policy and onCompleted not being called.
Works as expected with the default "cache-first" fetch policy.

version:

 "@apollo/client": "^3.0.0-rc.0"

@bengal75
Copy link

bengal75 commented Jun 27, 2020

After some scouring of open issues, I believe what I was experiencing here is a duplicate of #6301 - the suggested fix there of memoizing the onComplete and onError callbacks has stopped my query requests from looping. The reproduction there is also accurate for my use case so I suggest this issue can be closed in favour of that one.

@hwillson
Copy link
Member

hwillson commented May 3, 2021

This should no longer be an issue in @apollo/client@latest - let us know otherwise, thanks!

@hwillson hwillson closed this as completed May 3, 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.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants