The generated CreateDto does not include the null type for optional scalar fields.
Expected Behaviour
If a scalar field is nullable, the null type should be included in the CreateDto file.
The example below shows the middleName field being defined as optional in Prisma. Prisma treats this as automatic nullable in the database (and generates the correct type in @prisma/client).
However, the type generated in CreateDto is string instead of string | null.
Issue
The generated CreateDto does not include the
null
type for optional scalar fields.Expected Behaviour
If a scalar field is nullable, the
null
type should be included in the CreateDto file.The example below shows the
middleName
field being defined as optional in Prisma. Prisma treats this as automatic nullable in the database (and generates the correct type in @prisma/client).However, the type generated in CreateDto is
string
instead ofstring | null
.Example:
schema.prisma
create-person.dto.ts