Package org.eclipse.microprofile.graphql
Annotation Type 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:
For example, a user might annotate a method as such:
public class StockService {
@Subscription("stockQuote")
@Description("Get stock quote changes as they happen")
public Flow.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
-
Element Details
-
value
String value- Returns:
- the name to use for the subscription. If empty, annotated method's name is used.
- Default:
- ""
-