nexus-plugin-prisma icon indicating copy to clipboard operation
nexus-plugin-prisma copied to clipboard

Cannot control nullability of projected values

Open edjiang opened this issue 5 years ago • 0 comments

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.

edjiang avatar Dec 21 '20 04:12 edjiang