Annotation Type Mutation


@Retention(CLASS) @Target(METHOD) public @interface Mutation
Declares a GraphQLClient method as a GraphQL mutation. Identical in shape to Query -- the value() is the operation document and Var-annotated parameters supply its $variables -- but sent as a mutation. The method ends with an OnComplete<GraphQLResponse<T>> callback.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The GraphQL operation document, e.g.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The operation name to send in the request's operationName field.
  • Element Details

    • value

      String value
      The GraphQL operation document, e.g. mutation AddReview($ep: Episode!, $review: ReviewInput!) { createReview(episode: $ep, review: $review) { stars } }.
    • operationName

      String operationName
      The operation name to send in the request's operationName field. Optional; required only when value() declares more than one operation.
      Default:
      ""