Skip to content

Add support of INPUT_FIELD_DEFINITION location #6

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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