rustclanR
tRPC4y ago
6 replies
rustclan

Calling a trpc endpoint inside of a trpc endpoint

Hey all.

I'm wondering how I am able to call these endpoints from within themselves?

For example, I'd like to call
getBotGuilds
and
getUserGuilds
from within
getAllGuilds
.
export const guildRouter = createTRPCRouter({
  getBotGuilds: protectedProcedure.query(({ ctx }) => {
  }),
  getUserGuilds: protectedProcedure.query(({ ctx }) => {
    
    return [];
  }),
  getAllGuilds: protectedProcedure.query(({ ctx }) => {

  }),
});
Was this page helpful?