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

Method invalidate

packages/query-core/src/query.ts:686–690  ·  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

684 * ```
685 */
686 invalidate(): void {
687 if (!this.state.isInvalidated) {
688 this.#dispatch({ type: 'invalidate' })
689 }
690 }
691
692 /**
693 * 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