Hi all, Im having this weird issue where I'm missi...
# orm-help
a
Hi all, Im having this weird issue where I'm missing a role (whose type is an enum) field from my user object in the datamodel.
Copy code
type User {
  id: ID! @unique
  email: String @unique
  firstName: String!
  middleName: String
  lastName: String!
  password: String!
  role: Role!
  orders: [Order!]!
}

enum Role { 
  Admin
  Owner
  Physician
  Patient
  Provider
  Disabled
}
when I
createUser()
I've manually added the Role, and I have tried to also put it as a
@default
directive, however, when I call back or fetch on user the Role value is not there thus interfering with my permissions etc. Would any one able to shed some light? I am using prisma 1.17
h
Are you using prisma-client-lib or graphql-bindings?
one suggestion I can give you is try uppercasing the enum constants you have like Admin -> ADMIN and do the same while adding it.
maybe related to https://github.com/prisma/prisma/issues/3155 cant really confirm, will try to reproduce
a
Yup! I fixed it thanks! I needed to update to 1.18.1 !
🙌 1
h
Okay great to hear 🙂
Also wanna know does Admin in this 'case' works or you changed it to ADMIN , cause if 'Admin' don't work it is an new issue I guess
a
Admin wokred
did't need to make capitals
or should I?
h
Don't touch it if it worked 😉
a
True :)
Thanks for your inout man
🙂 1