KeepAlive
Keep the query alive.
Normally, a query stays active only when there are one or more references to it. This function is useful when you want to keep the query active for some reason even if it's not directly needed. For example, it can prevent data for a related query from becoming inactive, moving out of cache over time, such as when transitioning to a previous screen.
Parameters
key
The QueryKey to keep alive.
client
The QueryClient to resolve key. By default, it uses the LocalQueryClient.
Keep the infinite query alive.
Parameters
key
The InfiniteQueryKey to keep alive.
client
The QueryClient to resolve key. By default, it uses the LocalQueryClient.
See also
Keep the mutation alive.
Parameters
key
The MutationKey to keep alive.
client
The MutationClient to resolve key. By default, it uses the LocalMutationClient.