tRPCttRPC
Powered by
rustclanR
tRPC•4y 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
getBotGuilds
and
getUserGuilds
getUserGuilds
from within
getAllGuilds
getAllGuilds
.
export const guildRouter = createTRPCRouter({
  getBotGuilds: protectedProcedure.query(({ ctx }) => {
  }),
  getUserGuilds: protectedProcedure.query(({ ctx }) => {
    
    return [];
  }),
  getAllGuilds: protectedProcedure.query(({ ctx }) => {

  }),
});
export const guildRouter = createTRPCRouter({
  getBotGuilds: protectedProcedure.query(({ ctx }) => {
  }),
  getUserGuilds: protectedProcedure.query(({ ctx }) => {
    
    return [];
  }),
  getAllGuilds: protectedProcedure.query(({ ctx }) => {

  }),
});
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

calling api endpoints from within a trpc api endpoint?
rustclanRrustclan / ❓-help
4y ago
Use TRPC function inside of a TRPC function
santiSsanti / ❓-help
3y ago
Calling endpoint within another endpoint
vpjmVvpjm / ❓-help
10mo ago
Calling Express `request.send` inside tRPC middleware/procedures
skylerdjSskylerdj / ❓-help
16mo ago