betim
betim
Explore posts from servers
TtRPC
Created by betim on 6/8/2023 in #❓-help
Detecting batch queries/mutations on the server-side
ideally, something like this is the DX I was looking for https://www.typescriptlang.org/docs/handbook/functions.html#overloads for tRPC, using Zod-based schemas, instead of TS types, I'm sure something like it could be supported.. but I do realize it's a fairly niche case
14 replies
TtRPC
Created by betim on 6/8/2023 in #❓-help
Detecting batch queries/mutations on the server-side
yeah, that was one of the first approaches I was looking at but it foregoes the output type-safety I wanted
14 replies
TtRPC
Created by betim on 6/8/2023 in #❓-help
Detecting batch queries/mutations on the server-side
would be helpful from a DX standpoint for us but I'll go ahead with the separate procs for each case. thanks again!
14 replies
TtRPC
Created by betim on 6/8/2023 in #❓-help
Detecting batch queries/mutations on the server-side
thanks @Nick Lucas . I was hoping to avoid writing a batch-specific procedure, in addition to the single input use cases (both of which are relevant in different use-cases for us), but sounds like that isn't an option. I suppose if I'm gonna have to go down this route, one thing that would help is support for "overloading" in a TypeScript sense, in that I'd like to have a single named procedure (with two implementations) that supports a single input (producing a single output) as well as an array of inputs (producing an array of outputs). Is something like this supported in tRPC?
14 replies