πš™πŸΆπš›πšπšŠπš•
πš™πŸΆπš›πšπšŠπš•
TtRPC
Created by πš™πŸΆπš›πšπšŠπš• on 9/3/2024 in #❓-help
Router output types not mapping?
No description
4 replies
TtRPC
Created by πš™πŸΆπš›πšπšŠπš• on 9/1/2024 in #❓-help
v11: inferRouterInputs is returning `void | <zod object>` so it's unusable?
No description
5 replies
TtRPC
Created by πš™πŸΆπš›πšπšŠπš• on 8/30/2024 in #❓-help
Type too complex to infer?
No description
6 replies
TtRPC
Created by πš™πŸΆπš›πšπšŠπš• on 8/25/2024 in #❓-help
createCaller is returning [Function: noop]
env: node 20 pnpm I'm trying to call procedures locally, and when I console log the router, I see the trpc object ({mutations: ..., etc.}) But when I create the caller, it returns noop, and anything I call on that is noop. Ideas?
client.emit = createRouter(service);

const createCaller = createCallerFactory(client.emit);
const caller = createCaller({ client );
const result = await caller.connected(params);
client.emit = createRouter(service);

const createCaller = createCallerFactory(client.emit);
const caller = createCaller({ client );
const result = await caller.connected(params);
router:
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))
})
}
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))
})
}
2 replies