-
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
fetchMore with fetchPolicy: "no-cache" makes two requests #11965
Comments
Hi there @username14415 👋 Unfortunately, without a reproduction there's not much I do to help. If you're able to create one, I'd be happy to take a look. |
Using |
Hey @username14415 👋 I believe I'm able to reproduce this. Check out this reproduction which shows the multiple requests. I see the 2nd request kicked off after the first resolves. It helps to open this up the app in a separate window: https://y37kx4-3000.csb.app/. For whatever reason console logs are duplicated in the split view version giving a false sense of what is happening. |
I've got a failing test written for this in #11974. I've discovered some deeper issues with this as well that I think we need to discuss as a team, so I'm going to leave this in draft for now. Thanks for reporting the issue! |
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. |
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. |
Issue Description
fetchMore useQuery with fetchPolicy: "no-cache" just makes two requests. One with variables and the second request is with default variables. I can't post a link to reproduction, the requests are visible on the backend. NextJS 14.2 dev mode.
Link to Reproduction
Reproduction Steps
const { loading, fetchMore } = useQuery(GET_MESSAGES, { fetchPolicy: "no-cache", onCompleted: handleCompleted, onError: handleError, variables: { slug: params.slug, }, });
@apollo/client
version3.10.8
The text was updated successfully, but these errors were encountered: