marcos danielM
tRPC3y ago
2 replies
marcos daniel

can't call nested route

this is the top level router:
const appRouter = router({
    hello: procedure.query(() => 'hello world'),
    chess: chessRouter,
});

the chess router being something along these lines:
export const chessRouter = router({
    login: procedure.mutation(async (opts) => {
      //...
    }),
});


if I run the curl command like this it won't find the nested "login" mutation, although it works for top level "hello"

curl -X POST "http://localhost:6002/chess/login"

{"error":{"message":"No \"query\"-procedure on path \"chess/login/\"","code":-32004,"data":{"code":"NOT_FOUND","httpStatus":404,"stack":"TRPCError: No \"query\"-procedure on path \"chess/login/\"
Was this page helpful?