@kubb/plugin-react-query 5.5.0-canary.20261014T114046 → 5.5.0
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/dist/index.cjs +6 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/docs/options.md +13 -11
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -330,7 +330,7 @@ var compatibility = {
|
|
|
330
330
|
};
|
|
331
331
|
//#endregion
|
|
332
332
|
//#region package.json
|
|
333
|
-
var version = "5.5.0
|
|
333
|
+
var version = "5.5.0";
|
|
334
334
|
//#endregion
|
|
335
335
|
//#region ../../internals/client/src/resolveClient.ts
|
|
336
336
|
/**
|
|
@@ -650,13 +650,14 @@ function resolvePageParamType(node, { resolver, initialPageParam, queryParam })
|
|
|
650
650
|
}
|
|
651
651
|
/**
|
|
652
652
|
* Applies the shared query defaults during plugin setup: `false` disables query generation, and an
|
|
653
|
-
* object merges over `methods: ['GET']` and the plugin's runtime `importPath`.
|
|
653
|
+
* object merges over `methods: ['GET', 'QUERY']` and the plugin's runtime `importPath`. QUERY
|
|
654
|
+
* (RFC 10008) is a safe, idempotent read that carries its input in the body, so it is a query too.
|
|
654
655
|
*/
|
|
655
656
|
function resolveQueryConfig(query, options) {
|
|
656
657
|
if (query === false) return false;
|
|
657
658
|
return {
|
|
658
659
|
importPath: options.importPath,
|
|
659
|
-
methods: ["GET"],
|
|
660
|
+
methods: ["GET", "QUERY"],
|
|
660
661
|
...query
|
|
661
662
|
};
|
|
662
663
|
}
|
|
@@ -969,7 +970,7 @@ const queryKeyTransformer = ({ node, variant }) => {
|
|
|
969
970
|
if (isInfinite) urlFields.push("infinite: true");
|
|
970
971
|
const result = [`{ ${urlFields.join(", ")} }`];
|
|
971
972
|
if (query.length > 0) result.push("...(query ? [query] : [])");
|
|
972
|
-
if (node.requestBody?.content?.[0]?.schema) result.push("...(body ? [body] : [])");
|
|
973
|
+
if (node.requestBody?.content?.[0]?.schema) result.push("...(body !== undefined ? [body] : [])");
|
|
973
974
|
return result;
|
|
974
975
|
};
|
|
975
976
|
function QueryKey({ name, node, tsResolver, typeName, transformer, variant = "query" }) {
|
|
@@ -1912,7 +1913,7 @@ const mutationGenerator = defineGenerator({
|
|
|
1912
1913
|
//#region src/generators/queryGenerator.tsx
|
|
1913
1914
|
/**
|
|
1914
1915
|
* Built-in generator for `useQuery` hooks. Emits one `useFooQuery` hook per
|
|
1915
|
-
* GET operation (configurable via `query.methods`) plus the matching
|
|
1916
|
+
* GET and QUERY operation (configurable via `query.methods`) plus the matching
|
|
1916
1917
|
* `fooQueryKey` / `fooQueryOptions` helpers.
|
|
1917
1918
|
*/
|
|
1918
1919
|
const queryGenerator = defineGenerator({
|