Property 'query' does not exist on type 'DecorateProcedure<QueryProcedure<

Server is setup correctly, exact same code works on other projects. Cant figure out whats wrong here
No description
2 Replies
BootesVoid
BootesVoidOP10mo ago
import { z } from "zod";

import {
createTRPCRouter,
protectedProcedure,
publicProcedure,
} from "@/server/api/trpc";

export const taskRouter = createTRPCRouter({

create: protectedProcedure
.input(z.object({ name: z.string().min(1), description: z.string().optional()}))
.mutation(async ({ ctx, input }) => {
return ctx.db.task.create({
data: {
name: input.name,
description: input.description,
createdBy: { connect: { id: ctx.session.user.id } },
},
});
}),

getTasks: protectedProcedure.query(async ({ ctx }) => {
return await ctx.db.task.findMany({
where: { createdBy: { id: ctx.session.user.id } },
});
}),
});
import { z } from "zod";

import {
createTRPCRouter,
protectedProcedure,
publicProcedure,
} from "@/server/api/trpc";

export const taskRouter = createTRPCRouter({

create: protectedProcedure
.input(z.object({ name: z.string().min(1), description: z.string().optional()}))
.mutation(async ({ ctx, input }) => {
return ctx.db.task.create({
data: {
name: input.name,
description: input.description,
createdBy: { connect: { id: ctx.session.user.id } },
},
});
}),

getTasks: protectedProcedure.query(async ({ ctx }) => {
return await ctx.db.task.findMany({
where: { createdBy: { id: ctx.session.user.id } },
});
}),
});
Ani
Ani10mo ago
Did you find a solution?
Want results from more Discord servers?
Add your server