tRPCttRPC
Powered by
LeeL
tRPC•3y ago•
4 replies
Lee

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

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']
keyof AppRouter['_def']['queries']
anymore
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

Queries work but mutations do not
xdxd#5555 / hanyaXxdxd#5555 / hanya / ❓-help
3y ago
Mutations and Queries in React Contexts causing unexpected behaviors
NickNNick / ❓-help
3y ago
queries and mutations has wrong response type in client ( monorepo )
AmirrezaAAmirreza / ❓-help
2y ago
Help with queries vs mutations
CliffCCliff / ❓-help
3y ago