@openapi-qraft/react 1.0.0-beta.6 → 1.0.1
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/CHANGELOG.md +16 -0
- package/README.md +5 -3
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @openapi-qraft/react
|
|
2
2
|
|
|
3
|
+
## 1.0.1
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- c545cb2: chore: First release of the `@openapi-qraft/*` packages.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 269e464: feature: Add support for `useSuspenseQuery(..)` hook
|
|
12
|
+
- 8f0359d: Add a 'use client' header for compatibility with Next.js /app
|
|
13
|
+
- 0640daf: feature: Add support for `useMutationState(..)` hook
|
|
14
|
+
- ddb4d87: docs: Update README
|
|
15
|
+
- cc93fc3: feature: Add support for `useSuspenseInfiniteQuery(..)` hook
|
|
16
|
+
- 2509822: refactor: `getMutationKey` type, and change key composition logic if parameters are `undefined`
|
|
17
|
+
- fb6b450: chore: Bump
|
|
18
|
+
|
|
3
19
|
## 1.0.0-beta.6
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ hooks with typed parameters, ensuring that your API requests are both type-safe
|
|
|
21
21
|
First, install the core package for your project:
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
npm install @openapi-qraft/react
|
|
24
|
+
npm install @openapi-qraft/react
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
If your project doesn't already include `@tanstack/react-query`, you'll also need to install it. This package is
|
|
@@ -60,7 +60,7 @@ Next, use `@openapi-qraft/cli` to generate the services and typed Tanstack Query
|
|
|
60
60
|
to the TypeScript definitions generated in the previous step.
|
|
61
61
|
|
|
62
62
|
```bash
|
|
63
|
-
npx @openapi-qraft/cli
|
|
63
|
+
npx @openapi-qraft/cli https://api.dev.monite.com/openapi.json?version=2023-09-01 --output-dir src/api --openapi-types-import-path '../openapi.d.ts'
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
By completing these steps, you will generate `openapi.d.ts`, which serves as a TypeScript representation of the
|
|
@@ -265,7 +265,7 @@ const mutationState = qraft.entities.postEntitiesIdDocuments
|
|
|
265
265
|
?.at(0);
|
|
266
266
|
|
|
267
267
|
useEffect(() => {
|
|
268
|
-
if (mutationState
|
|
268
|
+
if (!mutationState || mutationState.status === 'iddle') {
|
|
269
269
|
mutate({ company_tax_id_verification: ['verification-id'] });
|
|
270
270
|
}
|
|
271
271
|
}, [mutate, mutationState?.status]);
|
|
@@ -285,6 +285,7 @@ useEffect(() => {
|
|
|
285
285
|
const infiniteQuery = qraft.posts.getPosts.useInfiniteQuery(
|
|
286
286
|
{ query: { limit: 10 } },
|
|
287
287
|
{
|
|
288
|
+
// * required by Tanstack Query
|
|
288
289
|
getNextPageParam: (lastPage, allPages, lastPageParams) => {
|
|
289
290
|
if (lastPage.length < 10) return; // if less than 10 items, there are no more pages
|
|
290
291
|
return {
|
|
@@ -293,6 +294,7 @@ const infiniteQuery = qraft.posts.getPosts.useInfiniteQuery(
|
|
|
293
294
|
},
|
|
294
295
|
};
|
|
295
296
|
},
|
|
297
|
+
// * required by Tanstack Query
|
|
296
298
|
initialPageParam: {
|
|
297
299
|
query: {
|
|
298
300
|
page: 1, // will be used in initial request
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openapi-qraft/react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "API client for React, providing type-safe requests and dynamic Tanstack Query React Hooks via a modular, Proxy-based architecture.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "rimraf dist/ && tsc --project tsconfig.build.json",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"type": "module",
|
|
14
14
|
"sideEffects": false,
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@openapi-qraft/cli": "~1.0.
|
|
17
|
-
"@openapi-qraft/openapi-typescript": "^1.0.0
|
|
16
|
+
"@openapi-qraft/cli": "~1.0.1",
|
|
17
|
+
"@openapi-qraft/openapi-typescript": "^1.0.0",
|
|
18
18
|
"@tanstack/react-query": "^5.17.3",
|
|
19
19
|
"@testing-library/jest-dom": "^5.17.0",
|
|
20
20
|
"@testing-library/react": "^13.4.0",
|