Annotation Interface Argument


@Target(PARAMETER) @Retention(RUNTIME) @Documented public @interface Argument
Annotation to bind a named GraphQL argument onto a method parameter.

Binding is performed by mapping argument values to a primary data constructor of the expected method parameter type, or by using a default constructor to create it and then map values to its properties. This is applied recursively, using all nested values and creating nested target objects.

If binding fails, a BindException is raised with binding issues accumulated as field errors where the field of each error is the argument path where the issue occurred.

If the method parameter is Map<String, Object> then the raw argument value for the named argument is used. For access to the full arguments map, use @Arguments instead.

This annotation has neither a "required" flag nor the option to specify a default value, both of which can be specified at the GraphQL schema level and are enforced by the GraphQL Java engine.

Since:
1.0.0
Author:
Rossen Stoyanchev
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The name of the input argument to bind to.
    Alias for name().