-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 the first time on 3.6.x #9655
Comments
@dairyisscary Can you try |
@benjamn thanks for getting back so quickly! No, unfortunately, I can still reproduce on |
@dairyisscary Can you try putting the relevant code into a runnable reproduction? I'll keep trying things on my side, but a reproduction helps a ton. |
@benjamn https://github.com/dairyisscary/duplicate-lazy-query main branch has it I struggled at first to reproduce it so I kept adding more and more of my configuration until I got it. it was the I'm less certain this is a bug now but i will say on apollo |
This is definitely something we (still) want to fix @dairyisscary! Thanks for the reproduction. 🙌 |
@dairyisscary Figured it out (I think)! |
@dairyisscary This should be fixed if you run |
amazing, seems to fix the issue in real app. thanks @benjamn! |
I have some code like this:
I click the button (once) but see two queries in the network tab. If i click the button a second time, with new
something
, the query appears to only fire one more time, as expectedIn my debugging, I found that this line is executing the query for the same variables and same options passed to
useLazyQuery
:apollo-client/src/react/hooks/useQuery.ts
Line 215 in 76ad8a7
for me, the second extra query has this:
Hopefully this is helpful and not just a red herring :)
The text was updated successfully, but these errors were encountered: