Annotation Interface Subscription


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

For example, a user might annotate a method as such:
 public class CharacterService {
     @Subscription
     @Description("Get stock quote changes as they happen")
     public Publisher<Stock> getStockQuote(String stockCode) {
         //...
     }
 }
 
Schema generation of this would result in a stanza such as:
 type Subscription {
    "Get stock quote changes as they happen"
    stockQuote(stockCode: string): [Stock]
 }
 
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
     
  • Element Details

    • value

      String value
      Returns:
      the name to use for the subscription. If empty, annotated method's name is used.
      Default:
      ""