Skip to content

Commit fa04a1d

Browse files
docs(vue-query): fix vue-query imports in docs, correct section replacements (TanStack#4728)
1 parent afbd788 commit fa04a1d

File tree

13 files changed

+34
-20
lines changed

13 files changed

+34
-20
lines changed

docs/react/graphql.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,5 @@ function App() {
5151
_You can find a [complete example in the repo](https://github.com/dotansimha/graphql-code-generator/tree/7c25c4eeb77f88677fd79da557b7b5326e3f3950/examples/front-end/react/tanstack-react-query)_
5252

5353
Get started with the [dedicated guide on GraphQL Code Generator documentation](https://www.the-guild.dev/graphql/codegen/docs/guides/react-vue).
54-
[//]: # (Codegen)
54+
55+
[//]: # 'Codegen'

docs/react/overview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ function Example() {
9191
```
9292

9393
[//]: # 'Example'
94+
[//]: # 'Materials'
9495

9596
## You talked me into it, so what now?
9697

97-
[//]: # 'Course'
98-
9998
- Consider taking the official [React Query Course](https://ui.dev/react-query?from=tanstack) (or buying it for your whole team!)
100-
[//]: # 'Course'
10199
- Learn React Query at your own pace with our amazingly thorough [Walkthrough Guide](../installation) and [API Reference](../reference/useQuery)
100+
101+
[//]: # 'Materials'

docs/react/typescript.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,11 @@ const { error } = useQuery<Group[], Error>(['groups'], fetchGroups)
113113
[typescript playground](https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbzgVwM4FMCKz1QJ5wC+cAZlBCHAORToCGAxjALQCOO+VAsAFCiSw4dAB7AIqUuUpURY1Nx68YeMOjgBxcsjBwAvIjjAAJgC44AO2QgARriK9eDCOdTwS6GAwAWmiNon6ABQAlGYAClLAGAA8vtoA2gC6AHx6qbLiAHQA5h6BVAD02Vpg8sGZMF7o5oG0qJAuarqpdQ0YmUZ0MHTBDjxOLvBIuORQRHooGNi4eLElSQA0cACiUKPJgfFUxX6lVIlL7p4+Jai9PAUFcNc3AHoA-LxAA)
114114

115115
[//]: # 'Playground6'
116+
[//]: # 'Materials'
116117

117118
## Further Reading
118119

119120
For tips and tricks around type inference, have a look at [React Query and TypeScript](../community/tkdodos-blog#6-react-query-and-typescript) from
120121
the Community Resources.
122+
123+
[//]: # 'Materials'

docs/vue/guides/initial-query-data.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ id: initial-query-data
33
title: Initial Query Data
44
ref: docs/react/guides/initial-query-data.md
55
---
6+
7+
[//]: # 'Materials'
8+
[//]: # 'Materials'

docs/vue/guides/mutations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function addTodo() {
3636

3737
```vue
3838
<script>
39-
import { useMutation } from 'vue-query'
39+
import { useMutation } from '@tanstack/vue-query'
4040
4141
const { error, mutate, reset } = useMutation({
4242
mutationFn: (newTodo) => axios.post('/todos', newTodo),

docs/vue/guides/paginated-queries.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ref: docs/react/guides/paginated-queries.md
99
```vue
1010
<script setup lang="ts">
1111
import { ref, Ref } from 'vue'
12-
import { useQuery } from 'vue-query'
12+
import { useQuery } from '@tanstack/vue-query'
1313
1414
const fetcher = (page: Ref<number>) =>
1515
fetch(

docs/vue/guides/queries.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ref: docs/react/guides/queries.md
77
[//]: # 'Example'
88

99
```ts
10-
import { useQuery } from 'vue-query'
10+
import { useQuery } from '@tanstack/vue-query'
1111

1212
const result = useQuery({ queryKey: ['todos'], queryFn: fetchTodoList })
1313
```
@@ -17,7 +17,7 @@ const result = useQuery({ queryKey: ['todos'], queryFn: fetchTodoList })
1717

1818
```vue
1919
<script setup>
20-
import { useQuery } from 'vue-query'
20+
import { useQuery } from '@tanstack/vue-query'
2121
2222
const { isLoading, isError, data, error } = useQuery({
2323
queryKey: ['todos'],
@@ -40,7 +40,7 @@ const { isLoading, isError, data, error } = useQuery({
4040

4141
```vue
4242
<script setup>
43-
import { useQuery } from 'vue-query'
43+
import { useQuery } from '@tanstack/vue-query'
4444
4545
const { status, data, error } = useQuery({
4646
queryKey: ['todos'],

docs/vue/guides/ssr.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ Vue Query supports prefetching multiple queries on the server and then _dehydrat
1212
First create `vue-query.ts` file in your `plugins` directory with the following content:
1313

1414
```ts
15-
import type { DehydratedState, VueQueryPluginOptions } from 'vue-query'
16-
import { VueQueryPlugin, QueryClient, hydrate, dehydrate } from 'vue-query'
15+
import type { DehydratedState, VueQueryPluginOptions } from '@tanstack/vue-query'
16+
import { VueQueryPlugin, QueryClient, hydrate, dehydrate } from '@tanstack/vue-query'
1717
// Nuxt 3 app aliases
1818
import { useState } from '#app'
1919

@@ -66,7 +66,7 @@ First create `vue-query.js` file in your `plugins` directory with the following
6666

6767
```js
6868
import Vue from 'vue'
69-
import { VueQueryPlugin, QueryClient, hydrate } from 'vue-query'
69+
import { VueQueryPlugin, QueryClient, hydrate } from '@tanstack/vue-query'
7070

7171
export default (context) => {
7272
// Modify your Vue Query global settings here
@@ -116,7 +116,7 @@ import {
116116
onServerPrefetch,
117117
useContext,
118118
} from "@nuxtjs/composition-api";
119-
import { useQuery, useQueryClient, dehydrate } from "vue-query";
119+
import { useQuery, useQueryClient, dehydrate } from "@tanstack/vue-query";
120120

121121
export default defineComponent({
122122
setup() {
@@ -152,7 +152,7 @@ Sync VueQuery client state with [vite-ssr](https://github.com/frandiox/vite-ssr)
152152
// main.js (entry point)
153153
import App from './App.vue'
154154
import viteSSR from 'vite-ssr/vue'
155-
import { QueryClient, VueQueryPlugin, hydrate, dehydrate } from 'vue-query'
155+
import { QueryClient, VueQueryPlugin, hydrate, dehydrate } from '@tanstack/vue-query'
156156

157157
export default viteSSR(App, { routes: [] }, ({ app, initialState }) => {
158158
// -- This is Vite SSR main hook, which is called once per request
@@ -186,7 +186,7 @@ Then, call VueQuery from any component using Vue's `onServerPrefetch`:
186186
</template>
187187

188188
<script setup>
189-
import { useQuery } from 'vue-query'
189+
import { useQuery } from '@tanstack/vue-query'
190190
import { onServerPrefetch } from 'vue'
191191

192192
// This will be prefetched and sent from the server

docs/vue/guides/suspense.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ And change your `setup` function in suspendable component to be `async`. Then yo
3131
```vue
3232
<script>
3333
import { defineComponent } from 'vue'
34-
import { useQuery } from 'vue-query'
34+
import { useQuery } from '@tanstack/vue-query'
3535
3636
const todoFetcher = async () =>
3737
await fetch('https://jsonplaceholder.cypress.io/todos').then((response) =>

docs/vue/overview.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,10 @@ replace: { 'React': 'Vue', 'react-query': 'vue-query' }
77

88
[//]: # 'Example'
99
[//]: # 'Example'
10-
[//]: # 'Course'
11-
[//]: # 'Course'
10+
[//]: # 'Materials'
11+
12+
## You talked me into it, so what now?
13+
14+
- Learn Vue Query at your own pace with our amazingly thorough [Walkthrough Guide](../installation) and [API Reference](../reference/useQuery)
15+
16+
[//]: # 'Materials'

0 commit comments

Comments
 (0)