-
Is there a way of preventing inactive state for Query? I have noticed that only observable queries are non inactive. But if I create Query via Use case that I have is: getting some complex data by fetching across multiple endpoints with multiple requests per endpoint. Logic behind that is in Service part of App that is only at the end of processing used in React Component. But data will be there always and be invalidated by hand. So question would be is there a easy way of using QueryCache fetching without Hooks and have caching layer with data being active (no inactive state)? Thanks :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 17 replies
-
So why would you need it to be in |
Beta Was this translation helpful? Give feedback.
So why would you need it to be in
active
state? As you said, only queries that have observers (rendered components viauseQuery
etc) areactive
. A query that isinactive
will be garbage-collected after thecacheTime
is reached - defaults to 5 minutes. If I got this right and you are only fetching, but never rendering, you can just increase thecacheTime
and you data will be available viaqueryCache.getQueryData
.