From ddf201f4aa7644dc3813172b4a0ca200881b734c Mon Sep 17 00:00:00 2001 From: waterWang Date: Sun, 16 Aug 2026 19:29:04 +0800 Subject: [PATCH] fix(query-core): fall back to query's own staleTime in isStatic() when no observers exist --- packages/query-core/src/query.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/query-core/src/query.ts b/packages/query-core/src/query.ts index 62bc9a16082..c1d54e7c070 100644 --- a/packages/query-core/src/query.ts +++ b/packages/query-core/src/query.ts @@ -298,7 +298,9 @@ export class Query< ) } - return false + // if a query has no observers, fall back to the query's own staleTime + // (mirrors isDisabled's no-observer fallback pattern) + return resolveStaleTime((this.options as any).staleTime, this) === 'static' } isStale(): boolean {