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

startTransition has no affect on refetch or fetchMore with errorPolicy: 'all' #11708

Closed
berzhavycha opened this issue Mar 20, 2024 · 4 comments · Fixed by #11713
Closed

startTransition has no affect on refetch or fetchMore with errorPolicy: 'all' #11708

berzhavycha opened this issue Mar 20, 2024 · 4 comments · Fixed by #11713
Assignees

Comments

@berzhavycha
Copy link

Issue Description

When using startTransition with refetch, I expect "Loading..." not to appear when I click on fetchMore. I cannot change errorPolicy to another value as this is necessary for my project. You can change errorPolicy to another value, and everything will work correctly, but this is not what i want

Link to Reproduction

https://stackblitz.com/edit/stackblitz-starters-esklwr?file=src%2Fcomponents%2FApolloProvider.tsx

Reproduction Steps

No response

@apollo/client version

3.8.9

@jerelmiller
Copy link
Member

Hey @berzhavycha 👋

Thanks for the report and the reproduction! This is such a weird one. It doesn't look so much like it has to do with the value of the errorPolicy but rather where its set. I see the reproduction sets errorPolicy with defaultOptions. If I comment this out and instead move that error policy to the hook itself, the hook behaves as expected. See my fork of the reproduction to see this working as expected.

I'll dig into this a bit more soon, but looks like for now the workaround would be to set errorPolicy on the hook itself.

@jerelmiller
Copy link
Member

Thankfully I was able to figure this one out pretty quick 🙂. This one is fixed with #11713. I've tried this fix out with a fork of the reproduction and this is working as expected. Expect this to ship with the next patch version 🙂

Copy link
Contributor

Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better.

Copy link
Contributor

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 Apr 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants