T
tRPC

Calling a trpc endpoint inside of a trpc endpoint

Calling a trpc endpoint inside of a trpc endpoint

Rrustclan2/3/2023
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 }) => {

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

return [];
}),
getAllGuilds: protectedProcedure.query(({ ctx }) => {

}),
});
AKAlex / KATT 🐱2/3/2023
@cje did a video on this but I'm not on my laptop to find it Tldr don't do it
Rrustclan2/3/2023
Oh.. okay. If not this, how else?
UUUnknown User2/3/2023
Message Not Public
Sign In & Join Server To View
Rrustclan2/3/2023
Thanks for the responses guys. 🙂

Looking for more? Join the community!

T
tRPC

Calling a trpc endpoint inside of a trpc endpoint

Join Server
Recommended Posts
Frozen input paramIs it possible to define a parameter on input schema (zod) that will have a hardcoded/frozen value wtype mismatch between tRPC return (in sveltekit) and defined typei've got this piece of code: ```ts read: async () => { const res = await trpc($page).getCards.querpre fetch serveral prodecures dynamicallyHello!. I'm developing a React Native app which needs an offline mode for some assets that the user procedure input contextIs it possible to accesss context in trpc procedure input validation? I have an aray of values in tIs it normal to separate resolvers from routers?Wondering if it's common and/or whether it's a good idea to attempt to separate procedures from the i have an infinite loop within my hook but apps works as expected.when i console log inside this hook, it repeats non-stop every few seconds, but my app is working astrpc query running twiceHey guys. I have a trpc endpoint which makes a request to the discord api to fetch a list of the usetRPC Call To ServerOn the mobile version of my app, in NextJS, the build has to be static so I have to use my hosted weGet count of stages assigned to user with stage name?Need help in writing prisma query to get stages assigned to user with stage name? this is the schemeTRPC global loading pageHey. With trpc/nextjs I'm wondering if its possible to have a global loading context/state which is Multiple Clients/Services In tRPC ContextI know it's typical to pass around the prisma client in the trpc context, is the same true for otherUse middleware to send responseHello, how can I send a response from the middleware without executing the input, such as making a cdynamic router creationhas anyone been able to create a dynamic router? e.g. i pass in the schema and some metadata and it Type issue react query with enabled.We migrate to trpc and using @tanstack/react-query directly to the trpc syntax of trpc.procedureName