trpc-sveltekit icon indicating copy to clipboard operation
trpc-sveltekit copied to clipboard

Query params are all optional client side

Open parotech123 opened this issue 1 year ago • 0 comments
trafficstars

Describe the bug Every property of the trpcclient caller router is marked optional.

if i try to call a endpoint, such as

//Server side

myRoute = t.router({ myroute:t.procedure .input( z.object({ a:z.string() b:z.string() }) ) })

//*cliente side trpc().myToute.query()

properties a and b are marked as optional, so .query is actually considering

{a?:string, b?:string}

instead of

{a:string, b:string}

To Reproduce install the basics of the package

Expected behavior property of query params should not be optional if not specified otherwise

parotech123 avatar Sep 11 '24 19:09 parotech123