Skip to content

Input Validation #6

Open
Open
@lilianchiassai

Description

@lilianchiassai

Hello,

Thank you for your work on this extended validation. This is very helpful.

I am using graphql-java-kickstart with a very basic schema, and noticed that input used as arguments of a mutation would not be validated unless in an array with its own rule.

Example:

input UserInput {
  name: String @Size( min : 2, max : 255)
}

mutation {
  #does not trigger validation
  createUser(userInput: UserInput): User 
  #does not trigger validation
  createUser(userInputs: [UserInput]): [User]
  #trigger validation on both arguments and inputs
  createUser(userInputs: [UserInput] @Size( min : 0, max : 1)): User
}

Am I missing something? Is it the intended behavior or a restriction of graphql-java-tools (if so, it should be documented)?

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