Annotation Interface LocalContextValue


@Target(PARAMETER) @Retention(RUNTIME) @Documented public @interface LocalContextValue
Annotation to bind a method parameter to an attribute from the local GraphQLContext.

To bind to an attribute from the main context instead, see @ContextValue.

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

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The name of the value to bind to.
    boolean
    Whether the value is required.
    Alias for name().
  • Element Details

    • value

      @AliasFor("name") String value
      Alias for name().
      Default:
      ""
    • name

      @AliasFor("value") String name
      The name of the value to bind to.
      Default:
      ""
    • required

      boolean required
      Whether the value is required.

      Defaults to "true", leading to an exception thrown if the value is missing. Switch to "false" if you prefer null if the value is not present, or use Optional.

      Default:
      true