PrismaP
Prisma2y ago
1 reply
piscopancer

Get type of `create` with `connect`?

db.course.create({
  data: {
    title: 'New course',
    tutor: {
      connect: {
        id: 1
      }
    }
  }
})


I would like to get the type for object I pass to
create
function. How can I do that? I assume I should use internal Prisma utility types, right?

The trick here is that
tutor
is a required property so it must be either created or connected (in my case, connected)
Was this page helpful?