Technology & Testing More detail B · Official guidance Platform: Web

Query Invalidation

Query invalidation marks matching cached data as old. Related data that is on screen can then refresh in the background.

See how it works
You might call it invalidate queriescache invalidationmark stale

See how it works

Original worked exampleQuery Invalidation

Another example

After a task is added, the task list becomes stale. The profile cache stays fresh.

Main parts

  1. 01Mutation result
  2. 02Query-key match
  3. 03Stale marker
  4. 04Targeted refetch

Use it when

Use it after a change may make one or more cached queries out of date.

Do not use it when

Do not clear every cached query after one small change.

Name used in code

mutation -> match query key -> stale -> refetch

Before you ship

Check the runtime and version, integration limits, dependencies and licenses, and platform support. Verify security, failure, speed, monitoring, deploy, support owner, upgrade path, and rollback.

Request you can copy

Outcome: Use or review Query Invalidation as a technical building block that the team can maintain. User context: After a task is added, the task list becomes stale. The profile cache stays fresh. Technology or engineering concept: Query Invalidation. Why it fits: Use it after a change may make one or more cached queries out of date. Do not use it when: Do not clear every cached query after one small change. Engineering fit: Define where it runs and which version to use. Set its job, interfaces, data flow, dependencies, supported systems, security, and speed limits. Explain how it fits the current stack. Lifecycle safeguards: Check dependency health and licenses. Add monitoring and a fallback. Name the upgrade owner. Do not add a second tool for the same job without a measured benefit. Acceptance criteria: A small integration proves the needed behavior. Test compatibility, security, failure, and performance. Document deploy, upgrade, support, and rollback steps. Evidence and limits (evidence boundary): It is official for that source. Other platforms or teams may use the term in another way. Unknowns to confirm: Current stack, runtime and version rules, target systems, dependency owner, performance budget, support period, and migration limits.

Check this request

Review the current use of Query Invalidation. Definition: Query invalidation marks matching cached data as old. Related data that is on screen can then refresh in the background. Release checks: Check the runtime and version, integration limits, dependencies and licenses, and platform support. Verify security, failure, speed, monitoring, deploy, support owner, upgrade path, and rollback. Before changing code, report the evidence you found, gaps, severity, and the smallest safe fix.

B
How official is this term?

Official guidance

The named platform, framework, project, or expert group has an official guide for this term.

It is official for that source. Other platforms or teams may use the term in another way.

Scope
TanStack Query invalidation
Document status
stable
Checked on
2026-07-30

Evidence sources & scope

Authority source + Term reference · TanStack Query · stable Query Invalidation Scope: Marking matching queries stale and refetching them Role here: Direct term reference Source covers: canonical name, definition, platform API, implementation, usage guidance

Copy it yourself

The browser could not copy this. Select the request below and copy it yourself.