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

Skip not skipping query in useQuery #9673

Closed
egemenuzunali opened this issue May 4, 2022 · 7 comments · Fixed by #9823
Closed

Skip not skipping query in useQuery #9673

egemenuzunali opened this issue May 4, 2022 · 7 comments · Fixed by #9823

Comments

@egemenuzunali
Copy link

egemenuzunali commented May 4, 2022

Intended outcome:
Setting skip to true in useQuery params should skip the query.

Actual outcome:
Setting skip to true does not skip the query when refetch is used

How to reproduce the issue:
Create a query with skip params while also using refetch

Versions

Sorry to open this again but the fix mentioned in #6190 #6752 did not fix the problem, please see the thread

@jpvajda jpvajda added 🐞 bug 🔍 investigate Investigate further labels Jun 3, 2022
@jpvajda
Copy link
Contributor

jpvajda commented Jun 3, 2022

Possibly related to #9765

@jpvajda
Copy link
Contributor

jpvajda commented Jun 3, 2022

@benjamn FYI.

@bsk26
Copy link

bsk26 commented Jun 10, 2022

We're seeing the issue on 3.6.6 with the following parameters to useQuery (and no refetch),

		{
			variables: { id },
			skip: true,
			fetchPolicy: 'cache-and-network',
			nextFetchPolicy: 'cache-first',
		}

We have workarounds but it is important for us that Apollo Client is reliable. The issue is especially bad because skip only intermittently fails: it appears it correctly skips the first useQuery but fails for later queries (the second time the query is loaded). This sets a trap for engineers.

@hwillson
Copy link
Member

@bsk26 any chance you can provide a small runnable reproduction that shows this happening?

@hwillson hwillson added 🥀 needs-reproduction and removed 🔍 investigate Investigate further labels Jun 13, 2022
@Titozzz
Copy link

Titozzz commented Jun 13, 2022

@hwillson this is probably a duplicate of #9765 , so prob the same repro applies https://codesandbox.io/s/apollo-client-3-6-3-skip-bug-5zbl63

@jpvajda
Copy link
Contributor

jpvajda commented Jun 13, 2022

Thanks @Titozzz since this is covered in #9765 I'm going to close this out and we can work from the other issue.

@benjamn
Copy link
Member

benjamn commented Jun 14, 2022

If this issue is indeed a duplicate of #9765, I'm optimistic PR #9823 will fix it.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
6 participants