01 · Before and afterThe pattern
// before: "disabled", but refetch() still calls the API and old data lingers
useQuery({ queryKey, queryFn: () => getBans(ref), enabled: isSupported })
// after: no query function exists while unsupported
useQuery({ queryKey, queryFn: isSupported ? () => getBans(ref) : skipToken })
// and, if consumers must not see stale rows: return isSupported ? data : undefined02 · Run it on your appThe check
For a feature that must never call an API in some state, does a manual refresh button also respect that rule?
If the honest answer is no or not sure, this is worth a look before it reaches production.