Skip to content

Commit eca0ec2

Browse files
committed
Reusable options
1 parent 391d8cb commit eca0ec2

File tree

1 file changed

+12
-20
lines changed
  • packages/openapi-react-query/src

1 file changed

+12
-20
lines changed

packages/openapi-react-query/src/index.ts

+12-20
Original file line numberDiff line numberDiff line change
@@ -100,36 +100,28 @@ export type UseInfiniteQueryMethod<Paths extends Record<string, Record<HttpMetho
100100
Path extends PathsWithMethod<Paths, Method>,
101101
Init extends MaybeOptionalInit<Paths[Path], Method>,
102102
Response extends Required<FetchResponse<Paths[Path][Method], Init, Media>>,
103+
Options extends Omit<
104+
UseInfiniteQueryOptions<
105+
Response["data"],
106+
Response["error"],
107+
Response["data"],
108+
number,
109+
QueryKey<Paths, Method, Path>
110+
>,
111+
"queryKey" | "queryFn"
112+
>
103113
>(
104114
method: Method,
105115
url: Path,
106116
...[init, options, queryClient]: RequiredKeysOf<Init> extends never
107117
? [
108118
InitWithUnknowns<Init>?,
109-
Omit<
110-
UseInfiniteQueryOptions<
111-
Response["data"],
112-
Response["error"],
113-
Response["data"],
114-
number,
115-
QueryKey<Paths, Method, Path>
116-
>,
117-
"queryKey" | "queryFn"
118-
>?,
119+
Options?,
119120
QueryClient?,
120121
]
121122
: [
122123
InitWithUnknowns<Init>,
123-
Omit<
124-
UseInfiniteQueryOptions<
125-
Response["data"],
126-
Response["error"],
127-
Response["data"],
128-
number,
129-
QueryKey<Paths, Method, Path>
130-
>,
131-
"queryKey" | "queryFn"
132-
>?,
124+
Options?,
133125
QueryClient?,
134126
]
135127
) => UseInfiniteQueryResult<InfiniteData<Response["data"]>, Response["error"]>;

0 commit comments

Comments
 (0)