TanStack
API Reference

InvalidateQueryFilters

Defined in: packages/query-core/src/types.ts:892

The filters of queryClient.invalidateQueries: the QueryFilters that select the queries to invalidate, plus refetchType to choose which of them are refetched.

Extends

Type Parameters

TQueryKey

TQueryKey extends QueryKey = QueryKey

Properties

PropertyTypeDefault valueDescription
exact?booleanundefinedMatch query key exactly
fetchStatus?"fetching" | "paused" | "idle"undefinedInclude queries matching their fetchStatus
predicate?(query: Query) => booleanundefinedInclude queries matching this predicate function
queryKey?TQueryKey | TuplePrefixes<TQueryKey>undefinedInclude queries matching this query key
refetchType?QueryTypeFilter | "none"'active'Controls which of the matched (now-invalidated) queries are refetched in the background. - 'active': only queries with at least one active observer are refetched. - 'inactive': only queries with no active observer are refetched. - 'all': every matched query is refetched, active or not. - 'none': no query is refetched; matched queries are only marked as invalidated.
stale?booleanundefinedInclude or exclude stale queries
type?QueryTypeFilter'all'Filter to active queries, inactive queries or all queries