Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forwarding directives to input types #21

Open
jakubknejzlik opened this issue Aug 21, 2019 · 0 comments
Open

Forwarding directives to input types #21

jakubknejzlik opened this issue Aug 21, 2019 · 0 comments

Comments

@jakubknejzlik
Copy link
Contributor

Currently it's possible to specify custom directives for fields. They are propagated to the final schema, but only for type fields. We need a way how to specify custom directives that need to be used for input fields (eg. for validation purposes).

Example:

// model.graphql
type User {
  email: String! @validation(email: true)
  age: Int @validation(min: 0) 
}

// gen/schema.graphql
input UserCreateInput {
  id: ID
  email: String! @validation(email: true)
  age: Int @validation(min: 0) 
}

input UserUpdateInput {
  email: String @validation(email: true)
  age: Int @validation(min: 0) 
}

The question is how to choose which directives propagate to type fields and which to create/update input fields (I'm not sure if it's ok to propagate them all).

@jakubknejzlik jakubknejzlik changed the title Forwarding directives for input types Forwarding directives to input types Aug 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant