Skip to content

Commit 7534b46

Browse files
authored
Merge branch 'v5' into remove-overloads
2 parents 556aedd + 67ed215 commit 7534b46

File tree

121 files changed

+2424
-357
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+2424
-357
lines changed

.all-contributorsrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,15 @@
297297
"contributions": [
298298
"code"
299299
]
300+
},
301+
{
302+
"login": "Mamoanwar97",
303+
"name": "Mahmoud M. Anwar",
304+
"avatar_url": "https://avatars.githubusercontent.com/u/36894846?v=4",
305+
"profile": "http://linkedin.com/in/mamoanwar97/",
306+
"contributions": [
307+
"code"
308+
]
300309
}
301310
],
302311
"contributorsPerLine": 7,

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ body:
9898
- type: input
9999
id: rq-version
100100
attributes:
101-
label: Tanstack Query version
101+
label: TanStack Query version
102102
description: |
103-
Please let us know the exact version of Tanstack Query you were using when the issue occurred. Please don't just put in "latest", as this is subject to change.
103+
Please let us know the exact version of TanStack Query you were using when the issue occurred. Please don't just put in "latest", as this is subject to change.
104104
placeholder: |
105105
e.g. v3.30.1
106106
validations:

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
9999
<tr>
100100
<td align="center"><a href="https://kubajastrz.com"><img src="https://avatars.githubusercontent.com/u/6443113?v=4?s=100" width="100px;" alt="Jakub Jastrzębski"/><br /><sub><b>Jakub Jastrzębski</b></sub></a><br /><a href="https://github.com/TanStack/query/commits?author=KubaJastrz" title="Code">💻</a></td>
101101
<td align="center"><a href="https://github.com/balazsmatepetro"><img src="https://avatars.githubusercontent.com/u/1608725?v=4?s=100" width="100px;" alt="Balázs Máté Petró"/><br /><sub><b>Balázs Máté Petró</b></sub></a><br /><a href="https://github.com/TanStack/query/commits?author=balazsmatepetro" title="Code">💻</a></td>
102+
<td align="center"><a href="http://linkedin.com/in/mamoanwar97/"><img src="https://avatars.githubusercontent.com/u/36894846?v=4?s=100" width="100px;" alt="Mahmoud M. Anwar"/><br /><sub><b>Mahmoud M. Anwar</b></sub></a><br /><a href="https://github.com/TanStack/query/commits?author=Mamoanwar97" title="Code">💻</a></td>
102103
</tr>
103104
</tbody>
104105
</table>

docs/config.json

Lines changed: 244 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,250 @@
436436
{
437437
"label": "Quick Start",
438438
"to": "vue/quick-start"
439+
},
440+
{
441+
"label": "Devtools",
442+
"to": "vue/devtools"
443+
},
444+
{
445+
"label": "TypeScript",
446+
"to": "vue/typescript"
447+
},
448+
{
449+
"label": "GraphQL",
450+
"to": "vue/graphql"
451+
}
452+
]
453+
},
454+
{
455+
"label": "Guides & Concepts",
456+
"children": [
457+
{
458+
"label": "Important Defaults",
459+
"to": "vue/guides/important-defaults"
460+
},
461+
{
462+
"label": "Queries",
463+
"to": "vue/guides/queries"
464+
},
465+
{
466+
"label": "Query Keys",
467+
"to": "vue/guides/query-keys"
468+
},
469+
{
470+
"label": "Query Functions",
471+
"to": "vue/guides/query-functions"
472+
},
473+
{
474+
"label": "Network Mode",
475+
"to": "vue/guides/network-mode"
476+
},
477+
{
478+
"label": "Parallel Queries",
479+
"to": "vue/guides/parallel-queries"
480+
},
481+
{
482+
"label": "Dependent Queries",
483+
"to": "vue/guides/dependent-queries"
484+
},
485+
{
486+
"label": "Background Fetching Indicators",
487+
"to": "vue/guides/background-fetching-indicators"
488+
},
489+
{
490+
"label": "Window Focus Refetching",
491+
"to": "vue/guides/window-focus-refetching"
492+
},
493+
{
494+
"label": "Disabling/Pausing Queries",
495+
"to": "vue/guides/disabling-queries"
496+
},
497+
{
498+
"label": "Query Retries",
499+
"to": "vue/guides/query-retries"
500+
},
501+
{
502+
"label": "Paginated Queries",
503+
"to": "vue/guides/paginated-queries"
504+
},
505+
{
506+
"label": "Infinite Queries",
507+
"to": "vue/guides/infinite-queries"
508+
},
509+
{
510+
"label": "Initial Query Data",
511+
"to": "vue/guides/initial-query-data"
512+
},
513+
{
514+
"label": "Placeholder Query Data",
515+
"to": "vue/guides/placeholder-query-data"
516+
},
517+
{
518+
"label": "Prefetching",
519+
"to": "vue/guides/prefetching"
520+
},
521+
{
522+
"label": "Mutations",
523+
"to": "vue/guides/mutations"
524+
},
525+
{
526+
"label": "Query Invalidation",
527+
"to": "vue/guides/query-invalidation"
528+
},
529+
{
530+
"label": "Invalidation from Mutations",
531+
"to": "vue/guides/invalidations-from-mutations"
532+
},
533+
{
534+
"label": "Updates from Mutation",
535+
"to": "vue/guides/updates-from-mutation-responses"
536+
},
537+
{
538+
"label": "Optimistic Updates",
539+
"to": "vue/guides/optimistic-updates"
540+
},
541+
{
542+
"label": "Query Cancellation",
543+
"to": "vue/guides/query-cancellation"
544+
},
545+
{
546+
"label": "Scroll Restoration",
547+
"to": "vue/guides/scroll-restoration"
548+
},
549+
{
550+
"label": "Filters",
551+
"to": "vue/guides/filters"
552+
},
553+
{
554+
"label": "SSR & Nuxt",
555+
"to": "vue/guides/ssr"
556+
},
557+
{
558+
"label": "Caching",
559+
"to": "vue/guides/caching"
560+
},
561+
{
562+
"label": "Default Query Fn",
563+
"to": "vue/guides/default-query-function"
564+
},
565+
{
566+
"label": "Suspense",
567+
"to": "vue/guides/suspense"
568+
},
569+
{
570+
"label": "Custom Logger",
571+
"to": "vue/guides/custom-logger"
572+
},
573+
{
574+
"label": "Testing",
575+
"to": "vue/guides/testing"
576+
},
577+
{
578+
"label": "Does this replace [Vuex, Pinia]?",
579+
"to": "vue/guides/does-this-replace-client-state"
580+
}
581+
]
582+
},
583+
{
584+
"label": "Community Resources",
585+
"children": [
586+
{
587+
"label": "TkDodo's Blog",
588+
"to": "vue/community/tkdodos-blog"
589+
},
590+
{
591+
"label": "Query Key Factory",
592+
"to": "vue/community/lukemorales-query-key-factory"
593+
}
594+
]
595+
},
596+
{
597+
"label": "Examples",
598+
"children": [
599+
{
600+
"label": "Basic",
601+
"to": "vue/examples/vue/basic"
602+
},
603+
{
604+
"label": "Vue 2.6",
605+
"to": "vue/examples/vue/2.6-basic"
606+
},
607+
{
608+
"label": "Nuxt 3",
609+
"to": "vue/examples/vue/nuxt3"
610+
},
611+
{
612+
"label": "Persister",
613+
"to": "vue/examples/vue/persister"
614+
}
615+
]
616+
},
617+
{
618+
"label": "API Reference",
619+
"children": [
620+
{
621+
"label": "useQuery",
622+
"to": "vue/reference/useQuery"
623+
},
624+
{
625+
"label": "useQueries",
626+
"to": "vue/reference/useQueries"
627+
},
628+
{
629+
"label": "useInfiniteQuery",
630+
"to": "vue/reference/useInfiniteQuery"
631+
},
632+
{
633+
"label": "useMutation",
634+
"to": "vue/reference/useMutation"
635+
},
636+
{
637+
"label": "useIsFetching",
638+
"to": "vue/reference/useIsFetching"
639+
},
640+
{
641+
"label": "useIsMutating",
642+
"to": "vue/reference/useIsMutating"
643+
},
644+
{
645+
"label": "useQueryClient",
646+
"to": "vue/reference/useQueryClient"
647+
},
648+
{
649+
"label": "QueryClient",
650+
"to": "vue/reference/QueryClient"
651+
},
652+
{
653+
"label": "QueryCache",
654+
"to": "vue/reference/QueryCache"
655+
},
656+
{
657+
"label": "MutationCache",
658+
"to": "vue/reference/MutationCache"
659+
},
660+
{
661+
"label": "QueryObserver",
662+
"to": "vue/reference/QueryObserver"
663+
},
664+
{
665+
"label": "InfiniteQueryObserver",
666+
"to": "vue/reference/InfiniteQueryObserver"
667+
},
668+
{
669+
"label": "QueriesObserver",
670+
"to": "vue/reference/QueriesObserver"
671+
},
672+
{
673+
"label": "focusManager",
674+
"to": "vue/reference/focusManager"
675+
},
676+
{
677+
"label": "onlineManager",
678+
"to": "vue/reference/onlineManager"
679+
},
680+
{
681+
"label": "hydration",
682+
"to": "vue/reference/hydration"
439683
}
440684
]
441685
}

docs/react/community/liaoliao666-react-query-kit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ $ yarn add react-query-kit
3030

3131
[CodeSandbox](https://codesandbox.io/s/example-react-query-kit-nextjs-uldl88)
3232

33-
```ts
33+
```tsx
3434
import { QueryClient, dehydrate } from '@tanstack/react-query'
3535
import { createQuery } from 'react-query-kit'
3636

docs/react/community/lukemorales-query-key-factory.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ $ yarn add @lukemorales/query-key-factory
2222
Start by defining the query keys for your app:
2323

2424
### Declare everything in a single file
25-
```ts
25+
```tsx
2626
import { createQueryKeyStore } from '@lukemorales/query-key-factory'
2727

2828
export const queryKeys = createQueryKeyStore({
@@ -36,7 +36,7 @@ export const queryKeys = createQueryKeyStore({
3636
```
3737

3838
### Fine-grained declaration by features
39-
```ts
39+
```tsx
4040
import { createQueryKeys, mergeQueryKeys } from '@lukemorales/query-key-factory'
4141

4242
// my-api/users.ts

docs/react/eslint/exhaustive-deps.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This makes sure that queries are cached independently and that queries are refet
1010

1111
Examples of **incorrect** code for this rule:
1212

13-
```ts
13+
```tsx
1414
/* eslint "@tanstack/query/exhaustive-deps": "error" */
1515

1616
useQuery({
@@ -26,7 +26,7 @@ const todoQueries = {
2626

2727
Examples of **correct** code for this rule:
2828

29-
```ts
29+
```tsx
3030
useQuery({
3131
queryKey: ["todo", todoId],
3232
queryFn: () => api.getTodo(todoId)

docs/react/eslint/prefer-query-object-syntax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ You can use [`useQuery`](https://tanstack.com/query/v4/docs/reference/useQuery)
77

88
Standard
99

10-
```ts
10+
```tsx
1111
useQuery(queryKey, queryFn?, options?)
1212

1313
// or

docs/react/graphql.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@ Because React Query's fetching mechanisms are agnostically built on Promises, yo
77

88
> Keep in mind that React Query does not support normalized caching. While a vast majority of users do not actually need a normalized cache or even benefit from it as much as they believe they do, there may be very rare circumstances that may warrant it so be sure to check with us first to make sure it's truly something you need!
99
10-
## Type-Safety and Code Generation
10+
[//]: # 'Codegen'
1111

12+
## Type-Safety and Code Generation
1213

1314
React Query, used in combination with `graphql-request^5` and [GraphQL Code Generator](https://graphql-code-generator.com/) provides full-typed GraphQL operations:
1415

1516
```tsx
16-
import request from 'graphql-request';
17-
import { useQuery } from '@tanstack/react-query';
17+
import request from 'graphql-request'
18+
import { useQuery } from '@tanstack/react-query'
1819

19-
import { graphql } from './gql/gql';
20+
import { graphql } from './gql/gql'
2021

2122
const allFilmsWithVariablesQueryDocument = graphql(/* GraphQL */ `
2223
query allFilmsWithVariablesQuery($first: Int!) {
@@ -29,7 +30,7 @@ const allFilmsWithVariablesQueryDocument = graphql(/* GraphQL */ `
2930
}
3031
}
3132
}
32-
`);
33+
`)
3334

3435
function App() {
3536
// `data` is fully typed!
@@ -40,13 +41,14 @@ function App() {
4041
'https://swapi-graphql.netlify.app/.netlify/functions/index',
4142
allFilmsWithVariablesQueryDocument,
4243
// variables are type-checked too!
43-
{first: 10}
44+
{ first: 10 },
4445
),
4546
})
4647
// ...
4748
}
4849
```
49-
_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)_
5050

51+
_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)_
5152

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

0 commit comments

Comments
 (0)