Annotation Type GraphQLClient
Marks an interface as a GraphQL client that the build-time
annotation processor wires up to a generated implementation. Each
abstract method carries one of Query, Mutation or
Subscription holding the GraphQL operation document, zero or more
Var-annotated parameters supplying its variables, an optional
@Header("Authorization") String bearer token, and a trailing
callback:
OnComplete<GraphQLResponse<T>>forQuery/Mutation;GraphQLSubscription.Handler<T>forSubscription, in which case the method returns aGraphQLSubscriptionhandle.
The processor emits a <SimpleName>Impl class and registers it with
GraphQLClients so the interface's
static T of(String endpoint) factory can return an instance
without the project source referencing the impl directly. Mirrors
RestClient and
GrpcClient.
-
Optional Element Summary
Optional Elements
-
Element Details
-
value
String valueOptional default GraphQL endpoint URL baked into the generatedof()factory's documentation. The effective endpoint is the argument passed toof(String endpoint); this value is purely informational and may be left empty.- Default:
""
-