betim
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
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