Skip to content

Commit

Permalink
docs(react-query): fix broken links in QueryClient docs (#8748)
Browse files Browse the repository at this point in the history
Co-authored-by: Lachlan Collins <[email protected]>
  • Loading branch information
KristianLonergan and lachlancollins authored Mar 7, 2025
1 parent e67b6f6 commit 2406435
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions docs/reference/QueryClient.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Its available methods are:
- `defaultOptions?: DefaultOptions`
- Optional
- Define defaults for all queries and mutations using this queryClient.
- You can also define defaults to be used for [hydration](../../framework/react/reference/hydration)
- You can also define defaults to be used for [hydration](../framework/react/reference/hydration)

## `queryClient.fetchQuery`

Expand Down Expand Up @@ -95,7 +95,7 @@ try {

**Options**

The options for `fetchQuery` are exactly the same as those of [`useQuery`](../../framework/react/reference/useQuery), except the following: `enabled, refetchInterval, refetchIntervalInBackground, refetchOnWindowFocus, refetchOnReconnect, refetchOnMount, notifyOnChangeProps, throwOnError, select, suspense, placeholderData`; which are strictly for useQuery and useInfiniteQuery. You can check the [source code](https://github.com/TanStack/query/blob/7cd2d192e6da3df0b08e334ea1cf04cd70478827/packages/query-core/src/types.ts#L119) for more clarity.
The options for `fetchQuery` are exactly the same as those of [`useQuery`](../framework/react/reference/useQuery), except the following: `enabled, refetchInterval, refetchIntervalInBackground, refetchOnWindowFocus, refetchOnReconnect, refetchOnMount, notifyOnChangeProps, throwOnError, select, suspense, placeholderData`; which are strictly for useQuery and useInfiniteQuery. You can check the [source code](https://github.com/TanStack/query/blob/7cd2d192e6da3df0b08e334ea1cf04cd70478827/packages/query-core/src/types.ts#L119) for more clarity.

**Returns**

Expand Down Expand Up @@ -172,7 +172,7 @@ const data = queryClient.getQueryData(queryKey)

**Options**

- `queryKey: QueryKey`: [Query Keys](../../framework/react/guides/query-keys)
- `queryKey: QueryKey`: [Query Keys](../framework/react/guides/query-keys)

**Returns**

Expand Down Expand Up @@ -234,7 +234,7 @@ const data = queryClient.getQueriesData(filters)

**Options**

- `filters: QueryFilters`: [Query Filters](../../framework/react/guides/filters#query-filters)
- `filters: QueryFilters`: [Query Filters](../framework/react/guides/filters#query-filters)
- if a filter is passed, the data with queryKeys matching the filter will be returned

**Returns**
Expand All @@ -260,7 +260,7 @@ queryClient.setQueryData(queryKey, updater)

**Options**

- `queryKey: QueryKey`: [Query Keys](../../framework/react/guides/query-keys)
- `queryKey: QueryKey`: [Query Keys](../framework/react/guides/query-keys)
- `updater: TQueryFnData | undefined | ((oldData: TQueryFnData | undefined) => TQueryFnData | undefined)`
- If non-function is passed, the data will be updated to this value
- If a function is passed, it will receive the old data value and be expected to return a new one.
Expand Down Expand Up @@ -298,7 +298,7 @@ console.log(state.dataUpdatedAt)

**Options**

- `queryKey: QueryKey`: [Query Keys](../../framework/react/guides/query-keys)
- `queryKey: QueryKey`: [Query Keys](../framework/react/guides/query-keys)

## `queryClient.setQueriesData`

Expand All @@ -310,7 +310,7 @@ queryClient.setQueriesData(filters, updater)

**Options**

- `filters: QueryFilters`: [Query Filters](../../framework/react/guides/filters#query-filters)
- `filters: QueryFilters`: [Query Filters](../framework/react/guides/filters#query-filters)
- if a filter is passed, queryKeys matching the filter will be updated
- `updater: TQueryFnData | (oldData: TQueryFnData | undefined) => TQueryFnData`
- the [setQueryData](#queryclientsetquerydata) updater function or new data, will be called for each matching queryKey
Expand All @@ -335,8 +335,8 @@ await queryClient.invalidateQueries(

**Options**

- `filters?: QueryFilters`: [Query Filters](../../framework/react/guides/filters#query-filters)
- `queryKey?: QueryKey`: [Query Keys](../../framework/react/guides/query-keys)
- `filters?: QueryFilters`: [Query Filters](../framework/react/guides/filters#query-filters)
- `queryKey?: QueryKey`: [Query Keys](../framework/react/guides/query-keys)
- `refetchType?: 'active' | 'inactive' | 'all' | 'none'`
- Defaults to `'active'`
- When set to `active`, only queries that match the refetch predicate and are actively being rendered via `useQuery` and friends will be refetched in the background.
Expand Down Expand Up @@ -377,7 +377,7 @@ await queryClient.refetchQueries({

**Options**

- `filters?: QueryFilters`: [Query Filters](../../framework/react/guides/filters#query-filters)
- `filters?: QueryFilters`: [Query Filters](../framework/react/guides/filters#query-filters)
- `options?: RefetchOptions`:
- `throwOnError?: boolean`
- When set to `true`, this method will throw if any of the query refetch tasks fail.
Expand All @@ -402,7 +402,7 @@ await queryClient.cancelQueries({ queryKey: ['posts'], exact: true })

**Options**

- `filters?: QueryFilters`: [Query Filters](../../framework/react/guides/filters#query-filters)
- `filters?: QueryFilters`: [Query Filters](../framework/react/guides/filters#query-filters)

**Returns**

Expand All @@ -418,7 +418,7 @@ queryClient.removeQueries({ queryKey, exact: true })

**Options**

- `filters?: QueryFilters`: [Query Filters](../../framework/react/guides/filters#query-filters)
- `filters?: QueryFilters`: [Query Filters](../framework/react/guides/filters#query-filters)

**Returns**

Expand All @@ -441,7 +441,7 @@ queryClient.resetQueries({ queryKey, exact: true })

**Options**

- `filters?: QueryFilters`: [Query Filters](../../framework/react/guides/filters#query-filters)
- `filters?: QueryFilters`: [Query Filters](../framework/react/guides/filters#query-filters)
- `options?: ResetOptions`:
- `throwOnError?: boolean`
- When set to `true`, this method will throw if any of the query refetch tasks fail.
Expand All @@ -464,11 +464,11 @@ if (queryClient.isFetching()) {
}
```

TanStack Query also exports a handy [`useIsFetching`](../../framework/react/reference/useIsFetching) hook that will let you subscribe to this state in your components without creating a manual subscription to the query cache.
TanStack Query also exports a handy [`useIsFetching`](../framework/react/reference/useIsFetching) hook that will let you subscribe to this state in your components without creating a manual subscription to the query cache.

**Options**

- `filters?: QueryFilters`: [Query Filters](../../framework/react/guides/filters#query-filters)
- `filters?: QueryFilters`: [Query Filters](../framework/react/guides/filters#query-filters)

**Returns**

Expand All @@ -484,11 +484,11 @@ if (queryClient.isMutating()) {
}
```

TanStack Query also exports a handy [`useIsMutating`](../../framework/react/reference/useIsMutating) hook that will let you subscribe to this state in your components without creating a manual subscription to the mutation cache.
TanStack Query also exports a handy [`useIsMutating`](../framework/react/reference/useIsMutating) hook that will let you subscribe to this state in your components without creating a manual subscription to the mutation cache.

**Options**

- `filters: MutationFilters`: [Mutation Filters](../../framework/react/guides/filters#mutation-filters)
- `filters: MutationFilters`: [Mutation Filters](../framework/react/guides/filters#mutation-filters)

**Returns**

Expand Down Expand Up @@ -539,7 +539,7 @@ function Component() {

**Options**

- `queryKey: QueryKey`: [Query Keys](../../framework/react/guides/query-keys)
- `queryKey: QueryKey`: [Query Keys](../framework/react/guides/query-keys)
- `options: QueryOptions`

> As stated in [`getQueryDefaults`](#queryclientgetquerydefaults), the order of registration of query defaults does matter.
Expand Down

0 comments on commit 2406435

Please sign in to comment.