Hi guys!
Describe the bug
I create type User with enum Gender
enum Gender {
MALE
FEMALE
}
type User {
id: ID! @unique
name: String!
gender: Gender!
}
Deploy to demo server and client generation passed successful
Next I create new User and want receive gender property
import { prisma } from './generated/prisma'
async function main() {
const user = await prisma.createUser({
name: 'Denis',
gender: 'MALE'
})
console.log(user.gender)
}
main()
But user.gender is undefined, property gender not exists in user
To Reproduce
I create repo with this bug:
[email protected]:4urbanoff/prisma-enum-bug.gitnpm inpm run bug or Launch program in vscode debuggerExpected behavior
Expected user.gender === 'MALE'
Screenshots


Versions
OS X High Sierraprisma CLI: prisma/1.17.0-beta.30 node-v8.11.1prisma:1.17-beta-1[email protected], [email protected], [email protected] Additional context
The problem is also stably reproduced in the local environment, e.g docker + mysql or docker + postgres.
Same here, Prisma Client don't return ENUM value. Any help?
Hi, thanks for the great bug report. This is a bug and we'll look into this soon!
Thanks!
This fix is available in the stable version - 1.18.1 - npm install -g prisma 馃帀
This bug has returned in version 1.25.7. I'm using Go client generator.
I had the same problem with user permissions but when my users sign up , i just defined the permission in the data mutation like this:
permissions:{ set:['OWNER']}
and it works correctly. You can just define a const outside from the request and put it there
I'm also facing the same bug, with the go client and it might also be related to #4463 . @pckhoi have you found a solution?
Not using enum?
That's what I did as well but I meant one using the enum list
Most helpful comment
This bug has returned in version 1.25.7. I'm using Go client generator.