-
The question is around having a polling master query and 1 or more dependent queries. tldr; Whenever polling 'master' query returns some condition, the dependent query should refetch. The polling master query returns a bunch of flags based on which different dependent queries should fetch data. I used the Can you please suggest if there's a better way? Thanks much. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Put all your dependencies that should trigger a refetch into the |
Beta Was this translation helpful? Give feedback.
Put all your dependencies that should trigger a refetch into the
queryKey
of the dependent query. react-query will automatically refetch if the queryKey changes. Alternatively, you can use therefetch
method and fire it off in auseEffect
.