Current behavior
When I try to explicit set, in this example, an user role to DRIVER and not pass it in the query arguments, it will default to CITIZEN.
Reproduction
Have the previous resolver with the user role defaulting to CITIZEN if nothing is passed in query arguments:
mutation {
createDriver(
data:{
email:"testing@this.com"
password:"1234567890"
}
) {
id
email
role
}
}
The role argument is not passed because I want to explicit tell it what role in the resolver, but it doesn't seem to work. It will save the mutation with the default role written in the datamodel.graphql.
Expected behavior?
If I explicit tell the resolver to create an user with the role DRIVER it should save the user with that role instead of defaulting to the one in datamodel.graphql.
Bug Report
I have in my
datamodel.graphql
the following for anUser
model:role: UserRole! @default(value: "CITIZEN")
The
UserRole
is:in
schema.graphl
:createDriver(data: UserCreateInput!): User!
and in the resolver:
Current behavior When I try to explicit set, in this example, an user role to
DRIVER
and not pass it in the query arguments, it will default toCITIZEN
.Reproduction Have the previous resolver with the user role defaulting to
CITIZEN
if nothing is passed in query arguments:The
role
argument is not passed because I want to explicit tell it what role in the resolver, but it doesn't seem to work. It will save the mutation with the defaultrole
written in thedatamodel.graphql
.Expected behavior? If I explicit tell the resolver to create an user with the role
DRIVER
it should save the user with that role instead of defaulting to the one indatamodel.graphql
.