@Target(value=PARAMETER) @Retention(value=RUNTIME) @Documented public @interface Argument
argument
.
If the method parameter is Map<String, Object>
or
and a parameter name is not specified, then the map parameter is populated
via DataFetchingEnvironment.getArguments()
.
Modifier and Type | Optional Element and Description |
---|---|
String |
defaultValue
The default value to use as a fallback when an input argument is
not present or has an empty value.
|
String |
name
The name of the input argument to bind to.
|
boolean |
required
Whether the input argument is required.
|
String |
value
Alias for
name() . |
public abstract boolean required
Defaults to true
, leading to an exception being thrown
if the argument is missing. Switch this to false
if you prefer
a null
value when the parameter is not present.
Alternatively, provide a defaultValue()
, which implicitly
sets this flag to false
.
public abstract String defaultValue
Supplying a default value implicitly sets required()
to
false
.