-
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
[AC v3] - query still requesting the server even when using skip (sometimes) #6572
Comments
It sounds a little bit similar to issue #6507 that I reported some time ago. There seems to be something really strange going on. |
@yngwi yes I think they might be related. I think there are 2 different things happening. As I pointed out, the first issue (my not be an issue) is that the first time the code runs, it actually skipped the request, but as soon as the variables changed, even tho the skip it still true, this |
This issue is also referenced in 6190. The suggested hack usually works. A very bad bug that keeps breaking many things and destroying the dependability of the library. |
This should now be fixed in |
@hwillson I just tested this with Can we please re open this? |
@hwillson I'm seeing the same issue. This is with Sharing more of what I'm seeing so you can repro: apollo-client/src/react/data/QueryData.ts Lines 242 to 257 in a928a10
And this is how the options are changing I am skipping once the customerId is |
We're running into this as well but with Is it possible to work around this issue by using lazy query in an effect? |
@sirugh A workaround is to create the variables outside of the useQuery. Check my OP |
Creating the |
@hwillson the issue still exists (when variables changes) , please re-open this V 3.1.0 |
@apollo/client 3.1.1, issue still occurs. Could we reopen this issue? Or should we open a new one? |
Track it here #6670 (comment) |
When skip is set to true but other updated options have been passed into `useQuery` (like updated variables), `useQuery` will still make a network request, even though it will skip the handling of the response. This commit makes sure `useQuery` doesn't make unnecessary `skip` network requests. Fixes #6670 Fixes #6190 Fixes #6572
When skip is set to true but other updated options have been passed into `useQuery` (like updated variables), `useQuery` will still make a network request, even though it will skip the handling of the response. This commit makes sure `useQuery` doesn't make unnecessary `skip` network requests. Fixes #6670 Fixes #6190 Fixes #6572
When skip is set to true but other updated options have been passed into `useQuery` (like updated variables), `useQuery` will still make a network request, even though it will skip the handling of the response. This commit makes sure `useQuery` doesn't make unnecessary `skip` network requests. Fixes #6670 Fixes #6190 Fixes #6572
When skip is set to true but other updated options have been passed into `useQuery` (like updated variables), `useQuery` will still make a network request, even though it will skip the handling of the response. This commit makes sure `useQuery` doesn't make unnecessary `skip` network requests. Fixes #6670 Fixes #6190 Fixes #6572
When skip is set to true but other updated options have been passed into `useQuery` (like updated variables), `useQuery` will still make a network request, even though it will skip the handling of the response. This commit makes sure `useQuery` doesn't make unnecessary `skip` network requests. Fixes #6670 Fixes #6190 Fixes #6572
I have a werid issue when using skip.
I have a query that is called only when a certain condition is met. This is how I'm doing the query
If I do that, the query is still being made. Even If I force the
skip
to true.useSubareasQuery
is actually called twice because the values of the variables changes.The first time, the value of the variables are this
Then one of the variables changes it's value, but the skip condition still true
The
key
is actually not equal toref.current.key
If I instead of doing the above I do this
Then it does actually works and skips the network request.
Should changing the underlying variables object affect the if the request being made?
Any ideas what could the issue be?
Versions
The text was updated successfully, but these errors were encountered: