nexus-plugin-prisma
nexus-plugin-prisma copied to clipboard
Cannot control nullability of projected values
Not sure if this is a feature or bug? 🙃
model User {
phoneNumber String @unique
emailAddress String? @unique
}
objectType({
name: 'User',
definition(t) {
t.model.phoneNumber()
t.model.emailAddress()
}
})
will render to:
type User {
phoneNumber: String!
emailAddress: String
}
Note that phoneNumber, despite being nullable in the Nexus definition, will render required in the graphql definition. Adding .nullable does not change anything.