@kubb/plugin-react-query 5.0.0-beta.4 → 5.0.0-beta.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -91
- package/dist/{components-dAKJEn9b.cjs → components-DQAYLQW0.cjs} +409 -279
- package/dist/components-DQAYLQW0.cjs.map +1 -0
- package/dist/{components-DTGLu4UV.js → components-IArDg-DO.js} +379 -279
- package/dist/components-IArDg-DO.js.map +1 -0
- package/dist/components.cjs +1 -1
- package/dist/components.d.ts +5 -77
- package/dist/components.js +1 -1
- package/dist/{generators-C_fbcjpG.js → generators-B86BJkmW.js} +346 -419
- package/dist/generators-B86BJkmW.js.map +1 -0
- package/dist/{generators-CWEQsdO9.cjs → generators-BqGaMUH6.cjs} +344 -417
- package/dist/generators-BqGaMUH6.cjs.map +1 -0
- package/dist/generators.cjs +1 -1
- package/dist/generators.d.ts +49 -10
- package/dist/generators.js +1 -1
- package/dist/index.cjs +176 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +32 -4
- package/dist/index.js +177 -27
- package/dist/index.js.map +1 -1
- package/dist/types-Dh4HNR9K.d.ts +400 -0
- package/extension.yaml +910 -364
- package/package.json +15 -17
- package/src/components/InfiniteQuery.tsx +24 -13
- package/src/components/InfiniteQueryOptions.tsx +37 -55
- package/src/components/Mutation.tsx +35 -15
- package/src/components/MutationOptions.tsx +14 -13
- package/src/components/Query.tsx +14 -10
- package/src/components/QueryOptions.tsx +17 -34
- package/src/components/SuspenseInfiniteQuery.tsx +19 -13
- package/src/components/SuspenseInfiniteQueryOptions.tsx +28 -52
- package/src/components/SuspenseQuery.tsx +9 -10
- package/src/generators/customHookOptionsFileGenerator.tsx +18 -14
- package/src/generators/hookOptionsGenerator.tsx +44 -51
- package/src/generators/infiniteQueryGenerator.tsx +57 -78
- package/src/generators/mutationGenerator.tsx +53 -64
- package/src/generators/queryGenerator.tsx +54 -63
- package/src/generators/suspenseInfiniteQueryGenerator.tsx +52 -65
- package/src/generators/suspenseQueryGenerator.tsx +56 -76
- package/src/plugin.ts +45 -31
- package/src/resolvers/resolverReactQuery.ts +102 -6
- package/src/types.ts +199 -61
- package/src/utils.ts +10 -33
- package/dist/components-DTGLu4UV.js.map +0 -1
- package/dist/components-dAKJEn9b.cjs.map +0 -1
- package/dist/generators-CWEQsdO9.cjs.map +0 -1
- package/dist/generators-C_fbcjpG.js.map +0 -1
- package/dist/types-DfaFRSBf.d.ts +0 -284
- /package/dist/{chunk--u3MIqq1.js → chunk-C0LytTxp.js} +0 -0
package/README.md
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<h1>Plugin React-Query</h1>
|
|
3
2
|
<a href="https://kubb.dev" target="_blank" rel="noopener noreferrer">
|
|
4
|
-
<img
|
|
3
|
+
<img src="https://kubb.dev/og.png" alt="Kubb banner">
|
|
5
4
|
</a>
|
|
6
5
|
|
|
7
6
|
[![npm version][npm-version-src]][npm-version-href]
|
|
8
7
|
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
9
|
-
[![
|
|
8
|
+
[![Stars][stars-src]][stars-href]
|
|
10
9
|
[![License][license-src]][license-href]
|
|
11
|
-
[![
|
|
10
|
+
[![Node][node-src]][node-href]
|
|
12
11
|
|
|
13
12
|
<h4>
|
|
14
|
-
<a href="https://
|
|
15
|
-
<span> · </span>
|
|
16
|
-
<a href="https://kubb.dev/" target="_blank">Documentation</a>
|
|
13
|
+
<a href="https://kubb.dev/plugins/react-query" target="_blank">Documentation</a>
|
|
17
14
|
<span> · </span>
|
|
18
15
|
<a href="https://github.com/kubb-labs/kubb/issues/" target="_blank">Report Bug</a>
|
|
19
16
|
<span> · </span>
|
|
@@ -21,103 +18,53 @@
|
|
|
21
18
|
</h4>
|
|
22
19
|
</div>
|
|
23
20
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
## Supporting Kubb
|
|
27
|
-
|
|
28
|
-
Kubb uses an MIT-licensed open source project with its ongoing development made possible entirely by the support of Sponsors. If you would like to become a sponsor, please consider:
|
|
29
|
-
|
|
30
|
-
- [Become a Sponsor on GitHub](https://github.com/sponsors/stijnvanhulle)
|
|
31
|
-
|
|
32
|
-
<p align="center">
|
|
33
|
-
<a href="https://github.com/sponsors/stijnvanhulle">
|
|
34
|
-
<img src="https://raw.githubusercontent.com/stijnvanhulle/sponsors/main/sponsors.svg" alt="My sponsors" />
|
|
35
|
-
</a>
|
|
36
|
-
</p>
|
|
37
|
-
|
|
38
|
-
<!-- Badges -->
|
|
39
|
-
|
|
40
|
-
[npm-version-src]: https://img.shields.io/npm/v/@kubb/plugin-tanstack-query?flat&colorA=18181B&colorB=f58517
|
|
41
|
-
[npm-version-href]: https://npmjs.com/package/@kubb/plugin-tanstack-query
|
|
42
|
-
[npm-downloads-src]: https://img.shields.io/npm/dm/@kubb/plugin-tanstack-query?flat&colorA=18181B&colorB=f58517
|
|
43
|
-
[npm-downloads-href]: https://npmjs.com/package/@kubb/plugin-tanstack-query
|
|
44
|
-
[license-src]: https://img.shields.io/github/license/kubb-labs/kubb.svg?flat&colorA=18181B&colorB=f58517
|
|
45
|
-
[license-href]: https://github.com/kubb-labs/kubb/blob/main/LICENSE
|
|
46
|
-
[build-src]: https://img.shields.io/github/actions/workflow/status/kubb-labs/kubb/ci.yaml?style=flat&colorA=18181B&colorB=f58517
|
|
47
|
-
[build-href]: https://www.npmjs.com/package/@kubb/plugin-tanstack-query
|
|
48
|
-
[minified-src]: https://img.shields.io/bundlephobia/min/@kubb/plugin-tanstack-query?style=flat&colorA=18181B&colorB=f58517
|
|
49
|
-
[minified-href]: https://www.npmjs.com/package/@kubb/plugin-tanstack-query
|
|
50
|
-
[coverage-src]: https://img.shields.io/codecov/c/github/kubb-labs/kubb?style=flat&colorA=18181B&colorB=f58517
|
|
51
|
-
[coverage-href]: https://www.npmjs.com/package/@kubb/plugin-tanstack-query
|
|
52
|
-
[sponsors-src]: https://img.shields.io/github/sponsors/stijnvanhulle?style=flat&colorA=18181B&colorB=f58517
|
|
53
|
-
[sponsors-href]: https://github.com/sponsors/stijnvanhulle/
|
|
54
|
-
|
|
55
|
-
## options query
|
|
21
|
+
<br />
|
|
56
22
|
|
|
57
|
-
|
|
23
|
+
# @kubb/plugin-react-query
|
|
58
24
|
|
|
59
|
-
|
|
60
|
-
UseQueryOptions => vue-query only
|
|
61
|
-
CreateQueryOptions => solid-query only
|
|
62
|
-
CreateQueryOptions => svelte-query only
|
|
25
|
+
### Generate TanStack Query hooks from OpenAPI
|
|
63
26
|
|
|
64
|
-
|
|
27
|
+
`@kubb/plugin-react-query` generates TanStack Query hooks from your OpenAPI specification. Each operation becomes a typed `useQuery`, `useMutation`, or `useInfiniteQuery` hook.
|
|
65
28
|
|
|
66
|
-
|
|
67
|
-
QueryObserverOptions => vue-query only https://github.com/TanStack/query/blob/main/packages/vue-query/src/useQuery.ts#L24
|
|
68
|
-
UseQueryOptions => solid-query only
|
|
29
|
+
## Installation
|
|
69
30
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
CreateQueryResult => solid-query only
|
|
77
|
-
CreateQueryResult => svelte-query only
|
|
78
|
-
|
|
79
|
-
### v5
|
|
80
|
-
|
|
81
|
-
UseQueryResult => react-query only
|
|
82
|
-
UseQueryReturnType => vue-query only
|
|
83
|
-
|
|
84
|
-
## queryOptions() query
|
|
85
|
-
|
|
86
|
-
### v5
|
|
87
|
-
|
|
88
|
-
queryOptions => react-query only
|
|
89
|
-
|
|
90
|
-
```typescript
|
|
91
|
-
{
|
|
92
|
-
query: {
|
|
93
|
-
types: {
|
|
94
|
-
options: 'UseBaseQueryOptions'
|
|
95
|
-
result: 'UseQueryResult'
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
31
|
+
```bash
|
|
32
|
+
bun add @kubb/plugin-react-query
|
|
33
|
+
# or
|
|
34
|
+
pnpm add @kubb/plugin-react-query
|
|
35
|
+
# or
|
|
36
|
+
npm install @kubb/plugin-react-query
|
|
99
37
|
```
|
|
100
38
|
|
|
101
|
-
##
|
|
39
|
+
## Documentation
|
|
102
40
|
|
|
103
|
-
|
|
41
|
+
See the [full documentation](https://kubb.dev/plugins/react-query) for configuration options and examples.
|
|
104
42
|
|
|
105
|
-
|
|
106
|
-
VueMutationObserverOptions => vue-query only
|
|
43
|
+
## Supporting Kubb
|
|
107
44
|
|
|
108
|
-
|
|
45
|
+
Kubb is an open source project, and its development is funded entirely by sponsors. If you would like to become a sponsor, please consider:
|
|
109
46
|
|
|
110
|
-
|
|
111
|
-
MutationObserverOptions => vue-query only
|
|
47
|
+
- [Become a Sponsor on GitHub](https://github.com/sponsors/stijnvanhulle)
|
|
112
48
|
|
|
113
|
-
|
|
49
|
+
<p align="center">
|
|
50
|
+
<a href="https://github.com/sponsors/stijnvanhulle">
|
|
51
|
+
<img src="https://raw.githubusercontent.com/stijnvanhulle/sponsors/main/sponsors.svg" alt="My sponsors" />
|
|
52
|
+
</a>
|
|
53
|
+
</p>
|
|
114
54
|
|
|
115
|
-
|
|
55
|
+
## License
|
|
116
56
|
|
|
117
|
-
|
|
118
|
-
UseMutationReturnType => vue-query only
|
|
57
|
+
[MIT](https://github.com/kubb-labs/plugins/blob/main/LICENSE)
|
|
119
58
|
|
|
120
|
-
|
|
59
|
+
<!-- Badges -->
|
|
121
60
|
|
|
122
|
-
|
|
123
|
-
|
|
61
|
+
[npm-version-src]: https://shieldcn.dev/npm/v/@kubb/plugin-react-query.svg?variant=secondary&size=xs&theme=zinc&mode=dark
|
|
62
|
+
[npm-version-href]: https://npmx.dev/package/@kubb/plugin-react-query
|
|
63
|
+
[npm-downloads-src]: https://shieldcn.dev/npm/dm/@kubb/plugin-react-query.svg?variant=secondary&size=xs&theme=zinc&mode=dark
|
|
64
|
+
[npm-downloads-href]: https://npmx.dev/package/@kubb/plugin-react-query
|
|
65
|
+
[stars-src]: https://shieldcn.dev/github/stars/kubb-labs/kubb.svg?variant=secondary&size=xs&theme=zinc&mode=dark
|
|
66
|
+
[stars-href]: https://github.com/kubb-labs/kubb
|
|
67
|
+
[license-src]: https://shieldcn.dev/npm/license/@kubb/plugin-react-query.svg?variant=secondary&size=xs&theme=zinc
|
|
68
|
+
[license-href]: https://github.com/kubb-labs/kubb/blob/main/LICENSE
|
|
69
|
+
[node-src]: https://shieldcn.dev/npm/node/@kubb/plugin-react-query.svg?variant=secondary&size=xs&theme=zinc&mode=dark
|
|
70
|
+
[node-href]: https://npmx.dev/package/@kubb/plugin-react-query
|