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

In-flight requests being aborted on un-mount by useLazyQuery rejects all suspended promises #10533

Closed
christiancho opened this issue Feb 8, 2023 · 3 comments · Fixed by #10698
Assignees
Labels
🏓 awaiting-team-response requires input from the apollo team ⏲️ react-suspense

Comments

@christiancho
Copy link

christiancho commented Feb 8, 2023

Issue Description

CC @jerelmiller

Context: #10427 (comment)

When using a custom suspender, I'm running into an issue with useLazyQuery and the automatic aborting of in-flight requests. Because the suspense boundary will unmount the rendering component while waiting for the promise to resolve, it immediately gets aborted and throws the error.

Link to Reproduction

https://codesandbox.io/s/bitter-fast-wwmqfb?file=/src/Countries/Countries.tsx

Reproduction Steps

Load the sandbox. Will see the error immediately.

@jerelmiller
Copy link
Member

jerelmiller commented Mar 31, 2023

Hey @christiancho 👋

We just released v3.7.11 that contains a change for useLazyQuery that will now allow the promise to resolve naturally rather than rejecting with an abort error. I tried this out in a fork of your reproduction and this now works as expected.

Thanks!

@christiancho
Copy link
Author

@jerelmiller MVP! This is amazing.

@github-actions
Copy link
Contributor

github-actions bot commented May 1, 2023

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
For general questions, we recommend using StackOverflow or our discord server.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🏓 awaiting-team-response requires input from the apollo team ⏲️ react-suspense
Projects
None yet
4 participants