Skip to content

Validation directives on nested Input fields example #385

Open
@PhilippS93

Description

@PhilippS93

Hello,

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

I want to use a directive to validate input fields like so:

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

There is a callback in SchemaDirectiveWiring:

default GraphQLInputObjectField onInputObjectField(SchemaDirectiveWiringEnvironment<GraphQLInputObjectField> environment) {
        return environment.getElement();
    }

but there is no example on how to use this method to validate the input. There are only examples for onArgument and onField callbacks.

Is it possible to provide examples for this kind of validation?

Thanks

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