Annotation Interface SchemaMapping


@Target({TYPE,METHOD}) @Retention(RUNTIME) @Documented public @interface SchemaMapping
Annotation to express the mapping of a handler method to a GraphQL type and field pair.

You can use this annotation both at the method and at the class level, in which case all handlers methods inherit the class-level typeName by default unless overridden at the method level.

Since:
1.0.0
Author:
Rossen Stoyanchev
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Customize the name of the GraphQL field to bind to.
    Customizes the name of the source/parent type for the GraphQL field.
    Effectively an alias for field().
  • Element Details

    • field

      @AliasFor("value") String field
      Customize the name of the GraphQL field to bind to.

      By default, if not specified, this is initialized from the method name.

      Default:
      ""
    • value

      @AliasFor("field") String value
      Effectively an alias for field().
      Default:
      ""
    • typeName

      String typeName
      Customizes the name of the source/parent type for the GraphQL field.

      By default, if not specified, it is derived from the class name of a source argument injected into the handler method.

      This attributed is supported at the class level and at the method level! When used on both levels, the one on the method level overrides the one at the class level.

      Default:
      ""