New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@default
doesnt work for enum
#33
Comments
We should think through the syntax for this again. Instead of
|
How about support of array values in default An example could be if a user can have multiple roles:
|
I like the second one ( |
This comment has been minimized.
This comment has been minimized.
Working on the engine level with direct GraphQL query. Datamodel needs to change (the one posted is quite old): model User {
id Int @id
name String
role Role @default(value: USER)
posts Post[]
}
model Post {
id Int @id
title String
author User
}
enum Role {
USER
ADMIN
} Query: mutation {
createOneUser(data:{
id: 2 // now needed because of the old implicit autoincrement behaviour on int IDs
name: "Test"
}) {
id
role
}
} Result: {
"data": {
"createOneUser": {
"id": 2,
"role": "USER"
}
}
} |
I adapted the reproduction above to alpha 917:
This leads to this output:
Is this the expected behavior @nikolasburk and this bug can be closed? |
Looks great, thanks again :) |
enum permission { model User { |
I have this datamodel:
Because
role
has adefault
value, it can be omitted in the Photon API call:When I execute this code, I get the following error:
The text was updated successfully, but these errors were encountered: