Annotation Type GraphQLEnum


@Documented
@Retention(RUNTIME)
@Target(TYPE)
public @interface GraphQLEnum
Annotation used to mark an enum. This annotation can be placed on a Java enum to make it usable as a GraphQL type.

 @GraphQLEnum
 public enum Test {
   VALUE,

   @GraphQLName("RENAMED")
   RENAMED_VALUE;
 }
 

Specific annotation values can be named and described by placing annotations on their declarations. See GraphQLName and GraphQLDescription.

Conversion from another enumeration can be performed via a static factory:

 public enum Test {
   VALUE,

   @GraphQLName("RENAMED")
   RENAMED_VALUE;

   @GraphQLFactory
   public static Test resolve(@GraphQLSource OtherEnum other) {
      switch(other) {
         case VALUE:
           return Test.VALUE;
         ...
      }

      throw new AssertionError("Unsupported: " + other);
   }
 }