Annotation Interface Mutation


@Retention(RUNTIME) @Target(METHOD) @Documented public @interface Mutation
Specifies that the annotated method provides the implementation (ie. the resolver) for a GraphQL mutation.

For example, a user might annotate a method as such:
 public class CharacterService {
     @Mutation("addCharacter")
     @Description("Save a new character")
     public Character save(Character character) {
         //...
     }
 }
 
Schema generation of this would result in a stanza such as:
 type Mutation {
     # Save a new character
     addCharacter(character: CharacterInput): Character
 }
 
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
     
  • Element Details

    • value

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