Currently, @constraint supports only ARGUMENT_DEFINITION directive location.
Problem: e.g. Prisma extracts all query/mutation arguments to separate input types when generates schema from datamodel.
Please add support of INPUT_FIELD_DEFINITION location to be able to apply @constraint to input type fields. E.g.:
type User {
name: String
phone: String
email: String
...
}
...
type Mutation {
createUser(data: UserCreateInput!): User!
updateUser(data: UserUpdateInput!, where: UserWhereUniqueInput!): User!
deleteUser(where: UserWhereUniqueInput!): User
...
}
...
input UserUpdateInput {
name: String
phone: String
email: String @constraint(format:"email")
...
}
Currently,
@constraintsupports onlyARGUMENT_DEFINITIONdirective location.Problem: e.g. Prisma extracts all query/mutation arguments to separate input types when generates schema from datamodel.
Please add support of
INPUT_FIELD_DEFINITIONlocation to be able to apply@constraintto input type fields. E.g.: