MCPcopy Create free account
hub / github.com/TanStack/query / invalidate

Method invalidate

packages/query-core/src/query.ts:574–578  ·  view source on GitHub ↗

* Marks the query as invalidated, unless it is already invalidated. This * updates `state.isInvalidated` and notifies observers, but does not by * itself trigger a refetch. * * @example * ```ts * query.invalidate() * ```

()

Source from the content-addressed store, hash-verified

572 * ```
573 */
574 invalidate(): void {
575 if (!this.state.isInvalidated) {
576 this.#dispatch({ type: 'invalidate' })
577 }
578 }
579
580 /**
581 * Fetches the query, i.e. runs its `queryFn` (through any configured

Callers 2

invalidateQueriesMethod · 0.80
query.test.tsxFile · 0.80

Calls 1

#dispatchMethod · 0.95

Tested by

no test coverage detected