I have TRPC question/problem

This works fine
getUser: publicProcedure
    .input(z.object({ id: z.string()}))
  .query(({ ctx ,input }) => {
    const user  = ctx.prisma.user.findUnique({
      where:{
        id:input.id,
      }
    })
   
    return user
  }),

But when I add
 select:{
        id:true,
        image: true,
        isTeacher: true,
        classes: true,
        name: true,
        admin: true
      }

but all fields are valid
Screenshot_2023-08-08_at_12.39.48_AM.png
Screenshot_2023-08-08_at_12.40.09_AM.png
Solution
npx prisma db push, restart your ide, should fix it
Was this page helpful?