# Annotation Type Query

@Retention(CLASS) @Target(METHOD) public @interface Query
Declares a `GraphQLClient` method as a GraphQL query. The `value()` is the operation document sent verbatim to the server; the method's `Var`-annotated parameters supply its `$variables`. The method ends with an `OnComplete<GraphQLResponse<T>>` callback whose `T` is the generated `@Mapped` response-data type.

- ## Required Element Summary

  Required Elements
  Modifier and Type
  Required Element
  Description
  `String`
  `value`
  The GraphQL operation document, e.g.

- ## Optional Element Summary

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

- ## Element Details

  - ### value

    String value
    The GraphQL operation document, e.g. `query HeroName($episode: Episode) { hero(episode: $episode) { name } }`.

  - ### 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:
      `""`