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 executes query twice on 3.6.9 #10106

Closed
ahmed-sharief5 opened this issue Sep 16, 2022 · 1 comment
Closed

useLazyQuery executes query twice on 3.6.9 #10106

ahmed-sharief5 opened this issue Sep 16, 2022 · 1 comment

Comments

@ahmed-sharief5
Copy link

ahmed-sharief5 commented Sep 16, 2022

I am using useLazyQuery in one of my component, but unfortunately it is calling the graphql api twice. I had referred to this issue #9655 as well but it did not resolve my issue. Because of this issue our application itself stopped rendering the components. Note: The same issue occurs when i use useQuery

Intended outcome:

Call the backend graphql api only once during the component mount

Actual outcome:

But the api is being called twice with the first request cancelled and the second request is being made and returning the result.

How to reproduce the issue:

Please see this example https://codesandbox.io/s/intelligent-framework-stwwmg

Versions

System:
Binaries:
Node: 14.17.3
Yarn: 1.22.19
npm: 6.14.13
Browsers:
Chrome: 103.0.5060.114

npmPackages:
@apollo/client: ^3.6.9
graphql: ^16.3.0
react: ^16.13.1

@ahmed-sharief5 ahmed-sharief5 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 16, 2022
@ahmed-sharief5
Copy link
Author

I had reinstalled and changed few components and it worked

@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

1 participant