@kubb/plugin-react-query 5.0.1 → 5.0.2

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
@@ -716,12 +716,11 @@ function InfiniteQueryOptions({ name, clientName, initialPageParam, cursorParam,
716
716
  memberTypeWrapper
717
717
  });
718
718
  const paramsSignature = declarationPrinter$7.print(paramsNode) ?? "";
719
- const queryFnBody = `const { data } = await ${buildClientCall(node, {
719
+ const queryFnBody = `return ${buildClientCall(node, {
720
720
  clientName,
721
721
  signal: true,
722
722
  unwrapName
723
- })}
724
- return data`;
723
+ })}.unwrap()`;
725
724
  const hasNewParams = nextParam != null || previousParam != null;
726
725
  const [getNextPageParamExpr, getPreviousPageParamExpr] = (() => {
727
726
  if (hasNewParams) {
@@ -1259,11 +1258,10 @@ function MutationOptions({ name, clientName, node, tsResolver, mutationKeyName }
1259
1258
  const groupedParamsNode = createFunctionParameters({ params: groupedParam ? [groupedParam] : [] });
1260
1259
  const TRequest = hasMutationParams ? tsResolver.response.options(node) : "undefined";
1261
1260
  const argBindingStr = hasMutationParams ? callPrinter$2.print(groupedParamsNode) ?? "" : "_";
1262
- const mutationFnBody = `const { data } = await ${buildClientCall(node, {
1261
+ const mutationFnBody = `return ${buildClientCall(node, {
1263
1262
  clientName,
1264
1263
  signal: false
1265
- })}
1266
- return data`;
1264
+ })}.unwrap()`;
1267
1265
  return /* @__PURE__ */ jsx(File.Source, {
1268
1266
  name,
1269
1267
  isExportable: true,
@@ -1437,11 +1435,10 @@ function QueryOptions({ name, clientName, node, tsResolver, queryKeyName }) {
1437
1435
  const queryKeyParamsCall = callPrinter.print(queryKeyParamsNode) ?? "";
1438
1436
  const paramsNode = buildQueryOptionsParams(node, { resolver: tsResolver });
1439
1437
  const paramsSignature = declarationPrinter.print(paramsNode) ?? "";
1440
- const queryFnBody = `const { data } = await ${buildClientCall(node, {
1438
+ const queryFnBody = `return ${buildClientCall(node, {
1441
1439
  clientName,
1442
1440
  signal: true
1443
- })}
1444
- return data`;
1441
+ })}.unwrap()`;
1445
1442
  return /* @__PURE__ */ jsx(File.Source, {
1446
1443
  name,
1447
1444
  isExportable: true,