Mohammed Anas
Mohammed Anas
TtRPC
Created by Mohammed Anas on 1/9/2024 in #❓-help
client side Validation with ZOD
will trpc validate input on the client before sending it to the server ?
12 replies
TtRPC
Created by Mohammed Anas on 1/3/2024 in #❓-help
How is the Client Generated with just the types
I'm trying to build a trpc like app for building restful apis with sveltekit. In trpc sveltekit only the type is passed to the client fucntion and how is the client object typically created with just the type?
2 replies
TtRPC
Created by Mohammed Anas on 11/18/2023 in #❓-help
How does trpc typing work
I'm curious to know how trpc generates type without a code gen step , i am trying to acheive something like this
export class API {
private schema:z.ZodSchema = z.undefined()
input<T>(inp:z.ZodSchema<T>){
this.schema = inp
return this
}
get(input:z.infer<typeof this.schema>){
console.log(("ok"));
}
}
const api = new API()
api.input(z.object({
name:z.string()
}))

// I need a way to typically extract this {name:string} type without a codegen step
export class API {
private schema:z.ZodSchema = z.undefined()
input<T>(inp:z.ZodSchema<T>){
this.schema = inp
return this
}
get(input:z.infer<typeof this.schema>){
console.log(("ok"));
}
}
const api = new API()
api.input(z.object({
name:z.string()
}))

// I need a way to typically extract this {name:string} type without a codegen step
8 replies