const profileData = await trpcClient.query( 'seer.evolution.getProfile', 'name' );
const profileData = await trpcClient.seer.evolution.getProfile.query('name');
// Define the merged router typetype MergedRouter = { relay: RelayRouter; evolution: EvolutionRouter; seer: SeerRouter;};// Initialize tRPC with the merged context if neededconst t = initTRPC .context<{ // Define any shared context here if necessary }>() .create();// Create the root routerexport const createRouter = () => t.router<MergedRouter>({ relay: createRelayRouter(), evolution: createEvolutionRouter(), seer: createSeerRouter(), });// Create a single tRPC instanceexport const trpc = createTRPCReact<AppRouter>();// Create the tRPC client with the combined linkexport const trpcClient = trpc.createClient({ links: [combinedLink],});
{mutations: ..., etc.}
client.emit = createRouter(service);const createCaller = createCallerFactory(client.emit);const caller = createCaller({ client );const result = await caller.connected(params);
export const createRouter = (service: Schema.Service) => { return router({ connected: procedure .use(hasRole('realm', t)) .use(customErrorFormatter(t)) .input(schema.connected) .mutation(({ input, ctx }) => service.connected(input as Schema.ConnectedInput, ctx)) })}