PrismaP
Prisma5d ago
4 replies
AhmedDaMohamed

Can Kinda Find `Prisma.Skip`?

hey

For some reason, VS Code tells me that:

`Property 'Skip' does not exist on type 'typeof import("some_project/src/generated/prisma/internal/prismaNamespace")'.


Buuutt... It still seems to work like normal. Just wanted to ask about it cause i thought it was kinda weird..

Heres' what I import in my .ts file:
import { PrismaClient, Prisma } from '@/generated/prisma/client'


Here's some code where I use it (uses ternary operator to check if
product.brand
is null. if it is, use Prisma.Skip):
prisma.product.create({data: {
         ... // some other fields
         brand: product.brand
          ? {
              connectOrCreate: {
                create: {
                  name: product.brand,
                },
                where: {
                  name: product.brand,
                },
              },
            }
          : Prisma.Skip,
Was this page helpful?