graphql-java-tools icon indicating copy to clipboard operation
graphql-java-tools copied to clipboard

Custom directive default parameter not loaded

Open pelletier197 opened this issue 5 years ago • 1 comments

I created this custom directive inside a spring boot project

directive @Email(message : String = "{path} must be a valid email") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION

and when I use it inside a query, this way:

 {
    updatePersonEmail(email: String @Email) {
    }
 }

then the default argument values of Email are not passed inside the directive. It's almost like directive declared and the one on the argument are not mapped together. Is this a wished behaviour, or is there something more to do?

pelletier197 avatar Sep 29 '20 21:09 pelletier197

I have the same issue with a 'ON FIELD_DEFINITION' directive.

At wiring time, the SchemaDirectiveWiringEnvironment<GraphQLFieldDefinition> does not seem to contain the values of arguments for which we specified defaults.

(And I also couldn't find a workaround way to access them)

alacoste avatar Oct 07 '20 18:10 alacoste