Skip to content

Commit 1b3faaf

Browse files
committed
fix: use z.input for body and query types for clients
1 parent 3778574 commit 1b3faaf

4 files changed

Lines changed: 10 additions & 3 deletions

File tree

.changeset/eleven-roses-know.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@ts-rest/core': patch
3+
'@ts-rest/react-query': patch
4+
'@ts-rest/solid-query': patch
5+
---
6+
7+
Use z.input for body and query types for clients

libs/ts-rest/core/src/lib/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type RecursiveProxyObj<T extends AppRouter> = {
1616
: never;
1717
};
1818

19-
type AppRouteMutationType<T> = T extends ZodTypeAny ? z.infer<T> : T;
19+
type AppRouteMutationType<T> = T extends ZodTypeAny ? z.input<T> : T;
2020

2121
/**
2222
* Extract the path params from the path in the contract

libs/ts-rest/react-query/src/lib/ts-rest-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type RecursiveProxyObj<T extends AppRouter> = {
3939
: never;
4040
};
4141

42-
type AppRouteMutationType<T> = T extends ZodTypeAny ? z.infer<T> : T;
42+
type AppRouteMutationType<T> = T extends ZodTypeAny ? z.input<T> : T;
4343

4444
type UseQueryArgs<TAppRoute extends AppRoute> = {
4545
useQuery: TAppRoute extends AppRouteQuery

libs/ts-rest/solid-query/src/lib/solid-query.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type RecursiveProxyObj<T extends AppRouter> = {
3939
: never;
4040
};
4141

42-
type AppRouteMutationType<T> = T extends ZodTypeAny ? z.infer<T> : T;
42+
type AppRouteMutationType<T> = T extends ZodTypeAny ? z.input<T> : T;
4343

4444
type UseQueryArgs<TAppRoute extends AppRoute> = {
4545
createQuery: TAppRoute extends AppRouteQuery

0 commit comments

Comments
 (0)