Skip to content

Add support of INPUT_FIELD_DEFINITION location #6

@FluorescentHallucinogen

Description

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")
  ...
}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions