@toktokhan-dev/cli-plugin-gen-api-react-query 0.0.4 → 0.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toktokhan-dev/cli-plugin-gen-api-react-query",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -131,7 +131,7 @@ const dataForReactHookTemplate = {
131
131
  <% if (config.httpClientType === config.constants.HTTP_CLIENT.AXIOS) { %> import { AxiosRequestConfig, AxiosResponse } from "axios"; <% } %>
132
132
 
133
133
  import { AxiosError } from 'axios';
134
- import { useQuery, useMutation, useInfiniteQuery } from '@tanstack/react-query';
134
+ import { useQuery, useMutation, useInfiniteQuery, InfiniteData } from '@tanstack/react-query';
135
135
  import { QueryHookParams, InfiniteQueryHookParams, MutationHookParams, Parameter, RequestFnReturn } from "../@types/react-query-type";
136
136
  import { paramsSerializerBy } "../@utils/param-serializer-by"
137
137
 
@@ -122,7 +122,7 @@ const dataForReactHookTemplate = {
122
122
  };
123
123
  %>
124
124
 
125
- import { useQuery, useMutation, useInfiniteQuery } from '@tanstack/react-query';
125
+ import { useQuery, useMutation, useInfiniteQuery, InfiniteData } from '@tanstack/react-query';
126
126
  import { QueryHookParams, InfiniteQueryHookParams, MutationHookParams, Parameter, RequestFnReturn } from "../@types/react-query-type";
127
127
  import { paramsSerializerBy } from "../@utils/param-serializer-by";
128
128
  import fetchExtended from "<%= instancePath %>";
@@ -75,7 +75,10 @@
75
75
 
76
76
  <% if (isQuery) { %>
77
77
  export const use<%~ classNameCase(functionName) %>Query = <
78
- TData = RequestFnReturn<typeof <%= apiInstanceName %>.<%~ functionName %>>,
78
+ TData = InfiniteData<
79
+ RequestFnReturn<typeof <%= apiInstanceName %>.<%~ functionName %>>,
80
+ Parameter<typeof <%= apiInstanceName %>.<%~ functionName %>>
81
+ >,
79
82
  >(
80
83
  <%~ conditionalParamsText %>: QueryHookParams<typeof <%= apiInstanceName %>.<%~ functionName %>,
81
84
  <% if (isAxiosInstance) { %>
@@ -12,7 +12,7 @@ import {
12
12
 
13
13
  export type QueryHookParams<
14
14
  T extends CustomRequestFn,
15
- Error = <%= errorType %>,
15
+ Error = <%~ errorType %>,
16
16
  TData = RequestFnReturn<T>,
17
17
  OriginData = RequestFnReturn<T>,
18
18
  Variables = Parameter<T>,
@@ -25,7 +25,7 @@ export type QueryHookParams<
25
25
 
26
26
  export type InfiniteQueryHookParams<
27
27
  T extends CustomRequestFn,
28
- Error = <%= errorType %>,
28
+ Error = <%~ errorType %>,
29
29
  TData = RequestFnReturn<T>,
30
30
  OriginData = RequestFnReturn<T>,
31
31
  Variables = Parameter<T>,
@@ -40,7 +40,7 @@ export type InfiniteQueryHookParams<
40
40
 
41
41
  export type MutationHookParams<
42
42
  T extends CustomRequestFn,
43
- Error = <%= errorType %>,
43
+ Error = <%~ errorType %>,
44
44
  Data = RequestFnReturn<T>,
45
45
  Variables = Parameter<T>,
46
46
  > = {