piscopancer
piscopancer
Explore posts from servers
PPrisma
Created by piscopancer on 6/14/2024 in #help-and-questions
Get type of `create` with `connect`?
db.course.create({
data: {
title: 'New course',
tutor: {
connect: {
id: 1
}
}
}
})
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)
2 replies