Skip to content

Forwarding directives to input types #21

@jakubknejzlik

Description

@jakubknejzlik

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions