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

useLazyQuery, onCompleted/onError, "no-cache"/"network-only", infinite loop. #6346

Closed
itshallrun opened this issue May 26, 2020 · 3 comments
Closed

Comments

@itshallrun
Copy link

Intended outcome:
useLazyQuery in combination with onCompleted/onError should execute once.

Actual outcome:
Executing useLazyQuery in combination with onCompleted/onError leads to an infinite loop with loading === false.

How to reproduce the issue:
Click here for a Codesandbox example

useLazyQuery

Versions
bug was introduced in "@apollo/client": "3.0.0-beta.46",
all versions above are affected by the issue

@fdev
Copy link

fdev commented May 26, 2020

Probably the same issue as #6301.

@hwillson
Copy link
Member

Confirmed duplicate of #6301. We'll track progress in that issue. Thanks!

@joshuarobs
Copy link

I got this same error if I have onCompleted as async, calling an async mutation, on apollo client 3.2.0. However, i fixed it by not using async in the onCompleted for the lazy query.

@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