Skip to content

It seems that a useQuery() sometimes gets unsubscribed for no apparent reason, how can I accurately diagnose when this happens? #171

Answered by DamianOsipiuk
Evertt asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, could you try to use the new vue-query devtools plugin for the vue devtools?
In there you can find the timeline with events about vue-query.
Then after getting back to your application you can check whether query got refetched after page has been refocused (it should be the case, unless you opt-out from that via config).
This should tell us whether query has still active subscription and only optimistic updates get broken, or whole subscription got lost.


Solution:

You should use useQueryClient instead of importing your own queryClient instance. This will get the same reference that useQuery uses.

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@Evertt
Comment options

@Evertt
Comment options

@DamianOsipiuk
Comment options

@Evertt
Comment options

@DamianOsipiuk
Comment options

Answer selected by Evertt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants