Annotation Interface Type


@Retention(RUNTIME) @Target(TYPE) @Documented public @interface Type
Maps of the annotated Java class to a GraphQL type.

For example, a user might annotate a class as such:
 @Type("Starship")
 @Description("A starship in Star Wars")
 public class Starship {
     private String id;
     private String name;
     private float length;

     // getters/setters...
 }
 
Schema generation of this would result in a stanza such as:
 # A starship in Star Wars
 type Starship {
   id: String
   name: String
   length: Float
 }
 
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
     
  • Element Details

    • value

      String value
      Returns:
      the name of the GraphQL type.
      Default:
      ""