-
-
Notifications
You must be signed in to change notification settings - Fork 150
[query-client] Omit params property when there are no params #303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hey this should be functioning already so I'm going to make as a bug and try write a failing test for this. Thanks! |
Hey @danielpza I can't create a minimal reproduction of this my side Can you check that you're using strict mode in TS in this app? Also can you send the contract you used for this EP please |
Hey @oliverbutler, I was able to reproduce it here https://github.com/danielpza/ts-rest-issue-303
Yes I'm using strict mode |
Thank you! I'll take a look :) |
@danielpza I've found the reason your example doesn't work and I'm not seeing the issue my side, Zod. Right now we rely on Zod for some underlying generics in @ts-rest/core Installing Zod, even just effectively as a dev dependency should make this work for you. We had an issue #44 but as of right now this isn't something we're working on removing, although not relying on Zod is definitely a goal of mine for ts-rest. |
Closing for right now, but I'll see if we've adequately documented this limitation (I'm doubtful we did!) |
Currently we need to pass an empty object as
params
even if no param is needed:The param property should be (imo) optional when it's not needed
The text was updated successfully, but these errors were encountered: