@kubb/plugin-vue-query 5.0.0 → 5.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/dist/index.js CHANGED
@@ -535,6 +535,16 @@ function resolveInfiniteConfig(infinite) {
535
535
  ...infinite
536
536
  };
537
537
  }
538
+ /**
539
+ * The request groups a query key is built from, matching `buildQueryKeyParams`. Headers are
540
+ * deliberately absent: they do not identify a cache entry, so the key factory takes no parameter
541
+ * for an operation that only carries headers.
542
+ */
543
+ const queryKeyGroupOrder = [
544
+ "path",
545
+ "query",
546
+ "body"
547
+ ];
538
548
  //#endregion
539
549
  //#region ../../internals/tanstack-query/src/components/InfiniteQueryOptions.tsx
540
550
  const declarationPrinter$7 = functionPrinter({ mode: "declaration" });
@@ -548,11 +558,7 @@ function InfiniteQueryOptions$1({ name, clientName, initialPageParam, cursorPara
548
558
  });
549
559
  const groupedKeyParam = buildGroupedRequestParam(node, {
550
560
  resolver: tsResolver,
551
- keys: [
552
- "path",
553
- "query",
554
- "body"
555
- ],
561
+ keys: queryKeyGroupOrder,
556
562
  memberTypeWrapper
557
563
  });
558
564
  const queryKeyParamsNode = createFunctionParameters({ params: groupedKeyParam ? [groupedKeyParam] : [] });
@@ -562,12 +568,11 @@ function InfiniteQueryOptions$1({ name, clientName, initialPageParam, cursorPara
562
568
  memberTypeWrapper
563
569
  });
564
570
  const paramsSignature = declarationPrinter$7.print(paramsNode) ?? "";
565
- const queryFnBody = `const { data } = await ${buildClientCall(node, {
571
+ const queryFnBody = `return ${buildClientCall(node, {
566
572
  clientName,
567
573
  signal: true,
568
574
  unwrapName
569
- })}
570
- return data`;
575
+ })}.unwrap()`;
571
576
  const hasNewParams = nextParam != null || previousParam != null;
572
577
  const [getNextPageParamExpr, getPreviousPageParamExpr] = (() => {
573
578
  if (hasNewParams) {
@@ -838,11 +843,7 @@ const declarationPrinter$4 = functionPrinter({ mode: "declaration" });
838
843
  function buildQueryKeyParamsNode(node, options) {
839
844
  const groupedParam = buildGroupedRequestParam(node, {
840
845
  resolver: options.resolver,
841
- keys: [
842
- "path",
843
- "query",
844
- "body"
845
- ],
846
+ keys: queryKeyGroupOrder,
846
847
  memberTypeWrapper: maybeRefOrGetter
847
848
  });
848
849
  return createFunctionParameters({ params: groupedParam ? [groupedParam] : [] });
@@ -893,11 +894,10 @@ function QueryOptions({ name, clientName, node, tsResolver, queryKeyName }) {
893
894
  const queryKeyParamsCall = callPrinter$3.print(queryKeyParamsNode) ?? "";
894
895
  const paramsNode = getQueryOptionsParams(node, { resolver: tsResolver });
895
896
  const paramsSignature = declarationPrinter$3.print(paramsNode) ?? "";
896
- const queryFnBody = `const { data } = await ${buildVueClientCall(node, {
897
+ const queryFnBody = `return ${buildVueClientCall(node, {
897
898
  clientName,
898
899
  signal: true
899
- })}
900
- return data`;
900
+ })}.unwrap()`;
901
901
  return /* @__PURE__ */ jsx(File.Source, {
902
902
  name,
903
903
  isExportable: true,
@@ -1033,11 +1033,10 @@ function Mutation({ name, clientName, node, tsResolver, mutationKeyName }) {
1033
1033
  const hasMutationParams = groupedParam !== null;
1034
1034
  const groupedParamsNode = createFunctionParameters({ params: groupedParam ? [groupedParam] : [] });
1035
1035
  const argBindingStr = hasMutationParams ? callPrinter$1.print(groupedParamsNode) ?? "" : "";
1036
- const mutationFnBody = `const { data } = await ${buildVueClientCall(node, {
1036
+ const mutationFnBody = `return ${buildVueClientCall(node, {
1037
1037
  clientName,
1038
1038
  signal: false
1039
- })}
1040
- return data`;
1039
+ })}.unwrap()`;
1041
1040
  const generics = [
1042
1041
  TData,
1043
1042
  TError,