Add some more clarity to the RQ docs (#10120)

This commit is contained in:
Eric Bailey
2026-04-06 18:45:40 -05:00
committed by GitHub
parent 011d8d2f7c
commit 99257f2816
7 changed files with 152 additions and 61 deletions
+3 -19
View File
@@ -19,22 +19,6 @@ export const STALE = {
INFINITY: Infinity,
}
/**
* Root key for persisted queries.
*
* If the `querykey` of your query uses this at index 0, it will be
* persisted automatically by the `PersistQueryClientProvider` in
* `#/lib/react-query.tsx`.
*
* Be careful when using this, since it will change the query key and may
* break any cases where we call `invalidateQueries` or `refetchQueries`
* with the old key.
*
* Also, only use this for queries that are safe to persist between
* app launches (like user preferences).
*
* Note that for queries that are persisted, it is recommended to extend
* the `gcTime` to a longer duration, otherwise it'll get busted
*/
export const PERSISTED_QUERY_ROOT = 'PERSISTED'
export const PERSISTED_QUERY_GCTIME = Infinity
export const GCTIME = {
INFINITY: Infinity,
}