PrismaP
Prisma2y ago
5 replies
bockster6669

Prisma Types

Pls somebody help with these types

type PostFindUniqueResult = Prisma.Result<
  typeof db.post,
  {
    where: {
      id: string;
    };
    include: {
      author: true;
      tags: true;
      comments: {
        include: {
          author: true;
        };
      };
    };
  },
  'findUnique'
>;

  let post: PostFindUniqueResult;
  
    post = await PostModel.findUnique({
      where: {
        id: params.id,
      },
      include: {
        author: true,
        tags: true,
        comments: {
          include: {
            author: true,
          },
        },
      },
    });

I am getting error that the type PostFindUniqueResult is not the same as the return type from PostModel.findUnique
Was this page helpful?