`.defined()` on input fields that has default value in schema
moander opened this issue · 2 comments
moander commented
Version: 0.12.0
The following query is accepted by the server, but .validate() fail with displayName must be defined.
The expected behavior is to allow the undefined value and let the server take care of the default as defined in the SDL.
mutation {
createLocation(input: {
model: {
description: ""
}
}) { id }
}input LocationCreateInput {
description: String
displayName: String! = ""
}yup.object({
description: yup.string().trim().defined().nullable().optional(),
displayName: yup.string().trim().defined().nonNullable(), // ERROR: displayName must be defined
})Code-Hex commented