Bert
Bert
TtRPC
Created by Bert on 11/25/2023 in #❓-help
tRPC is butchering object types in return types
So if I have a mutation that returns this type
{ name?: string }
{ name?: string }
the type that tRPC infers for the mutation is
type R = ReturnType<typeof trpcClient.mut.mutate>
R = Promise<Record<"name", string | undefined>>
type R = ReturnType<typeof trpcClient.mut.mutate>
R = Promise<Record<"name", string | undefined>>
This is not the same, with exactOptionalPropertyTypes. Anyone familiar with this who can provide some info about it?
6 replies