Skip to content

Remove required and defaultValue attributes from Argument annotation #150

Closed
@bclozel

Description

@bclozel

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.

Metadata

Metadata

Assignees

Labels

in: coreIssues related to config and core supportin: webIssues related to web handlingtype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions