Closed
Description
Currently, the @Argument
annotation allows to specify whether the input argument is required and set a default value if none was provided.
We've found that this can lead to confusing situations, since that information is supposed to be present already at the schema level.
For example, a greeting
query that requires a name
input argument:
type Query {
greeting(name: String!): String!
}
And here's a query schema that does not require it but specifies a default value:
type Query {
greeting(name: String = "Spring"): String!
}
The existing attributes on @Argument
add a duplicate layer and go against the "schema first" principle behind Spring GraphQL.