Ben Ezard
11/12/2021, 11:42 PMmodel Author {
name String
}
model Book {
author Author?
}
const book = await this.prismaService.book.create({
include: {
author: true,
},
data: {
author: {
create: {
name: 'Bob',
},
},
},
})
In the above example, book.author is nullable, yet that the fact that that function succeeded and is returning data means that that field will never be null
Is there an existing way to get book.author back as a non-nullable value, or should I create a feature request on GitHub for this?Ryan
11/15/2021, 5:52 AMcreate that you’re providing is optional.