T
tRPC

How do I get the queries and mutations list in v10?

How do I get the queries and mutations list in v10?

Ccorliansa6/28/2023
Hello, In tRPC v9 I can do:
const queries = Object.keys(appRouter._def.queries);
const mutations = Object.keys(appRouter._def.mutations);
const queries = Object.keys(appRouter._def.queries);
const mutations = Object.keys(appRouter._def.mutations);
I can still do it in v10, but it’s deprecated, so I am wondering if there is a better way to do it in v10? And in v10 the type is changed so I can’t do keyof AppRouter['_def']['queries'] anymore
AKAlex / KATT 🐱6/28/2023
_.def.record IIRC they are all in the same place then you can check which type it is

Looking for more? Join the community!

T
tRPC

How do I get the queries and mutations list in v10?

Join Server