tRPCttRPC
Powered by
BertB
tRPC•3y ago•
5 replies
Bert

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?
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Strange trpc types
XenostarXXenostar / ❓-help
3y ago
What types of data I could return from tRPC procedure?
Bart ⚡BBart ⚡ / ❓-help
17mo ago