You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: fix broken internal links in the query docs (v4) (#7398)
* Fixing links: round 1
* Fix more links
* Fix the rest of the links in the React docs
* Fix some broken links for the vue docs
* Fix the broken links in the svelte docs
Copy file name to clipboardExpand all lines: docs/framework/react/guides/caching.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ id: caching
3
3
title: Caching Examples
4
4
---
5
5
6
-
> Please thoroughly read the [Important Defaults](./guides/important-defaults) before reading this guide
6
+
> Please thoroughly read the [Important Defaults](../../../../framework/react/guides/important-defaults) before reading this guide
7
7
8
8
## Basic Example
9
9
@@ -23,7 +23,7 @@ Let's assume we are using the default `cacheTime` of **5 minutes** and the defau
23
23
- A second instance of `useQuery({ queryKey: ['todos'], queryFn: fetchTodos })` mounts elsewhere.
24
24
- Since the cache already has data for the `['todos']` key from the first query, that data is immediately returned from the cache.
25
25
- The new instance triggers a new network request using its query function.
26
-
- Note that regardless of whether both `fetchTodos` query functions are identical or not, both queries' [`status`](./reference/useQuery) are updated (including `isFetching`, `isLoading`, and other related values) because they have the same query key.
26
+
- Note that regardless of whether both `fetchTodos` query functions are identical or not, both queries' [`status`](../../../../framework/react/reference/useQuery) are updated (including `isFetching`, `isLoading`, and other related values) because they have the same query key.
27
27
- When the request completes successfully, the cache's data under the `['todos']` key is updated with the new data, and both instances are updated with the new data.
28
28
- Both instances of the `useQuery({ queryKey: ['todos'], queryFn: fetchTodos })` query are unmounted and no longer in use.
29
29
- Since there are no more active instances of this query, a cache timeout is set using `cacheTime` to delete and garbage collect the query (defaults to **5 minutes**).
Copy file name to clipboardExpand all lines: docs/framework/react/guides/important-defaults.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ Out of the box, TanStack Query is configured with **aggressive but sane** defaul
15
15
- The network is reconnected
16
16
- The query is optionally configured with a refetch interval
17
17
18
-
If you see a refetch that you are not expecting, it is likely because you just focused the window and TanStack Query is doing a [`refetchOnWindowFocus`](./guides/window-focus-refetching). During development, this will probably be triggered more frequently, especially because focusing between the Browser DevTools and your app will also cause a fetch, so be aware of that.
18
+
If you see a refetch that you are not expecting, it is likely because you just focused the window and TanStack Query is doing a [`refetchOnWindowFocus`](../window-focus-refetching). During development, this will probably be triggered more frequently, especially because focusing between the Browser DevTools and your app will also cause a fetch, so be aware of that.
19
19
20
20
> To change this functionality, you can use options like `refetchOnMount`, `refetchOnWindowFocus`, `refetchOnReconnect` and `refetchInterval`.
21
21
@@ -38,7 +38,7 @@ If you see a refetch that you are not expecting, it is likely because you just f
38
38
39
39
Have a look at the following articles from our Community Resources for further explanations of the defaults:
You can also pass this function as part of the 2nd argument (`queryFilters`) to [queryClient.refetchQueries](./reference/QueryClient#queryclientrefetchqueries), [queryClient.invalidateQueries](./reference/QueryClient#queryclientinvalidatequeries) or [queryClient.resetQueries](./reference/QueryClient#queryclientresetqueries).
141
+
You can also pass this function as part of the 2nd argument (`queryFilters`) to [queryClient.refetchQueries](../../../../reference/QueryClient#queryclientrefetchqueries), [queryClient.invalidateQueries](../../../../reference/QueryClient#queryclientinvalidatequeries) or [queryClient.resetQueries](../../../../reference/QueryClient#queryclientresetqueries).
Copy file name to clipboardExpand all lines: docs/framework/react/guides/initial-query-data.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,8 +8,8 @@ There are many ways to supply initial data for a query to the cache before you n
8
8
- Declaratively:
9
9
- Provide `initialData` to a query to prepopulate its cache if empty
10
10
- Imperatively:
11
-
-[Prefetch the data using `queryClient.prefetchQuery`](./guides/prefetching)
12
-
-[Manually place the data into the cache using `queryClient.setQueryData`](./guides/prefetching)
11
+
-[Prefetch the data using `queryClient.prefetchQuery`](../prefetching)
12
+
-[Manually place the data into the cache using `queryClient.setQueryData`](../prefetching)
13
13
14
14
## Using `initialData` to prepopulate a query
15
15
@@ -170,6 +170,6 @@ const result = useQuery({
170
170
171
171
## Further reading
172
172
173
-
For a comparison between `Initial Data` and `Placeholder Data`, have a look at the [Community Resources](./community/tkdodos-blog#9-placeholder-and-initial-data-in-react-query).
173
+
For a comparison between `Initial Data` and `Placeholder Data`, have a look at the [Community Resources](../../community/tkdodos-blog#9-placeholder-and-initial-data-in-react-query).
Copy file name to clipboardExpand all lines: docs/framework/react/guides/invalidations-from-mutations.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,4 +36,4 @@ const mutation = useMutation({
36
36
37
37
[//]: #'Example2'
38
38
39
-
You can wire up your invalidations to happen using any of the callbacks available in the [`useMutation` hook](./guides/mutations)
39
+
You can wire up your invalidations to happen using any of the callbacks available in the [`useMutation` hook](../../../../framework/react/guides/mutations)
Copy file name to clipboardExpand all lines: docs/framework/react/guides/migrating-to-react-query-3.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,8 +103,8 @@ try {
103
103
104
104
Together, these provide the same experience as before, but with added control to choose which component trees you want to reset. For more information, see:
Copy file name to clipboardExpand all lines: docs/framework/react/guides/mutations.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@ Beyond those primary states, more information is available depending on the stat
59
59
60
60
In the example above, you also saw that you can pass variables to your mutations function by calling the `mutate` function with a **single variable or object**.
61
61
62
-
Even with just variables, mutations aren't all that special, but when used with the `onSuccess` option, the [Query Client's `invalidateQueries` method](./reference/QueryClient#queryclientinvalidatequeries) and the [Query Client's `setQueryData` method](./reference/QueryClient#queryclientsetquerydata), mutations become a very powerful tool.
62
+
Even with just variables, mutations aren't all that special, but when used with the `onSuccess` option, the [Query Client's `invalidateQueries` method](../../../../reference/QueryClient#queryclientinvalidatequeries) and the [Query Client's `setQueryData` method](../../../../reference/QueryClient#queryclientsetquerydata), mutations become a very powerful tool.
63
63
64
64
[//]: #'Info1'
65
65
@@ -136,7 +136,7 @@ const CreateTodo = () => {
136
136
137
137
## Mutation Side Effects
138
138
139
-
`useMutation` comes with some helper options that allow quick and easy side-effects at any stage during the mutation lifecycle. These come in handy for both [invalidating and refetching queries after mutations](./guides/invalidations-from-mutations) and even [optimistic updates](./guides/optimistic-updates)
139
+
`useMutation` comes with some helper options that allow quick and easy side-effects at any stage during the mutation lifecycle. These come in handy for both [invalidating and refetching queries after mutations](../invalidations-from-mutations) and even [optimistic updates](../optimistic-updates)
If you persist offline mutations with the [persistQueryClient plugin](./plugins/persistQueryClient), mutations cannot be resumed when the page is reloaded unless you provide a default mutation function.
343
+
If you persist offline mutations with the [persistQueryClient plugin](../../../../framework/react/plugins/persistQueryClient), mutations cannot be resumed when the page is reloaded unless you provide a default mutation function.
344
344
345
345
This is a technical limitation. When persisting to an external storage, only the state of mutations is persisted, as functions cannot be serialized. After hydration, the component that triggers the mutation might not be mounted, so calling `resumePausedMutations` might yield an error: `No mutationFn found`.
346
346
@@ -383,13 +383,13 @@ export default function App() {
383
383
384
384
[//]: #'Example11'
385
385
386
-
We also have an extensive [offline example](./examples/offline) that covers both queries and mutations.
386
+
We also have an extensive [offline example](../../examples/offline) that covers both queries and mutations.
387
387
388
388
[//]: #'Materials'
389
389
390
390
## Further reading
391
391
392
-
For more information about mutations, have a look at [#12: Mastering Mutations in React Query](./community/tkdodos-blog#12-mastering-mutations-in-react-query) from
392
+
For more information about mutations, have a look at [#12: Mastering Mutations in React Query](../../community/tkdodos-blog#12-mastering-mutations-in-react-query) from
Copy file name to clipboardExpand all lines: docs/framework/react/guides/network-mode.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,13 +3,13 @@ id: network-mode
3
3
title: Network Mode
4
4
---
5
5
6
-
TanStack Query provides three different network modes to distinguish how [Queries](./guides/queries) and [Mutations](./guides/mutations) should behave if you have no network connection. This mode can be set for each Query / Mutation individually, or globally via the query / mutation defaults.
6
+
TanStack Query provides three different network modes to distinguish how [Queries](../../../../framework/react/guides/queries) and [Mutations](../../../../framework/react/guides/mutations) should behave if you have no network connection. This mode can be set for each Query / Mutation individually, or globally via the query / mutation defaults.
7
7
8
8
Since TanStack Query is most often used for data fetching in combination with data fetching libraries, the default network mode is [online](#network-mode-online).
9
9
10
10
## Network Mode: online
11
11
12
-
In this mode, Queries and Mutations will not fire unless you have network connection. This is the default mode. If a fetch is initiated for a query, it will always stay in the `state` (`loading`, `error`, `success`) it is in if the fetch cannot be made because there is no network connection. However, a [fetchStatus](./guides/queries#fetchstatus) is exposed additionally. This can be either:
12
+
In this mode, Queries and Mutations will not fire unless you have network connection. This is the default mode. If a fetch is initiated for a query, it will always stay in the `state` (`loading`, `error`, `success`) it is in if the fetch cannot be made because there is no network connection. However, a [fetchStatus](../../../../framework/react/guides/queries#fetchstatus) is exposed additionally. This can be either:
13
13
14
14
-`fetching`: The `queryFn` is really executing - a request is in-flight.
15
15
-`paused`: The query is not executing - it is `paused` until you have connection again
@@ -19,7 +19,7 @@ The flags `isFetching` and `isPaused` are derived from this state and exposed fo
19
19
20
20
> Keep in mind that it might not be enough to check for `loading` state to show a loading spinner. Queries can be in `state: 'loading'`, but `fetchStatus: 'paused'` if they are mounting for the first time, and you have no network connection.
21
21
22
-
If a query runs because you are online, but you go offline while the fetch is still happening, TanStack Query will also pause the retry mechanism. Paused queries will then continue to run once you re-gain network connection. This is independent of `refetchOnReconnect` (which also defaults to `true` in this mode), because it is not a `refetch`, but rather a `continue`. If the query has been [cancelled](./guides/query-cancellation) in the meantime, it will not continue.
22
+
If a query runs because you are online, but you go offline while the fetch is still happening, TanStack Query will also pause the retry mechanism. Paused queries will then continue to run once you re-gain network connection. This is independent of `refetchOnReconnect` (which also defaults to `true` in this mode), because it is not a `refetch`, but rather a `continue`. If the query has been [cancelled](../../../../framework/react/guides/query-cancellation) in the meantime, it will not continue.
23
23
24
24
## Network Mode: always
25
25
@@ -37,7 +37,7 @@ In those situations, the first fetch might succeed because it comes from an offl
37
37
38
38
## Devtools
39
39
40
-
The [TanStack Query Devtools](./devtools) will show Queries in a `paused` state if they would be fetching, but there is no network connection. There is also a toggle button to _Mock offline behavior_. Please note that this button will _not_ actually mess with your network connection (you can do that in the browser devtools), but it will set the [OnlineManager](./reference/onlineManager) in an offline state.
40
+
The [TanStack Query Devtools](../../../../framework/react/devtools) will show Queries in a `paused` state if they would be fetching, but there is no network connection. There is also a toggle button to _Mock offline behavior_. Please note that this button will _not_ actually mess with your network connection (you can do that in the browser devtools), but it will set the [OnlineManager](../../../../reference/onlineManager) in an offline state.
Copy file name to clipboardExpand all lines: docs/framework/react/guides/placeholder-query-data.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ There are a few ways to supply placeholder data for a query to the cache before
14
14
- Declaratively:
15
15
- Provide `placeholderData` to a query to prepopulate its cache if empty
16
16
- Imperatively:
17
-
-[Prefetch or fetch the data using `queryClient` and the `placeholderData` option](./guides/prefetching)
17
+
-[Prefetch or fetch the data using `queryClient` and the `placeholderData` option](../prefetching)
18
18
19
19
## Placeholder Data as a Value
20
20
@@ -80,6 +80,6 @@ function Todo({ blogPostId }) {
80
80
81
81
## Further reading
82
82
83
-
For a comparison between `Placeholder Data` and `Initial Data`, have a look at the [Community Resources](./community/tkdodos-blog#9-placeholder-and-initial-data-in-react-query).
83
+
For a comparison between `Placeholder Data` and `Initial Data`, have a look at the [Community Resources](../..//community/tkdodos-blog#9-placeholder-and-initial-data-in-react-query).
Alternatively, if you already have the data for your query synchronously available, you don't need to prefetch it. You can just use the [Query Client's `setQueryData` method](./reference/QueryClient#queryclientsetquerydata) to directly add or update a query's cached result by key.
28
+
Alternatively, if you already have the data for your query synchronously available, you don't need to prefetch it. You can just use the [Query Client's `setQueryData` method](../../../..//reference/QueryClient#queryclientsetquerydata) to directly add or update a query's cached result by key.
For a deep-dive on how to get data into your Query Cache before you fetch, have a look at [#17: Seeding the Query Cache](./community/tkdodos-blog#17-seeding-the-query-cache) from the Community Resources.
41
+
For a deep-dive on how to get data into your Query Cache before you fetch, have a look at [#17: Seeding the Query Cache](../..//community/tkdodos-blog#17-seeding-the-query-cache) from the Community Resources.
0 commit comments