public final class GraphQLClients

  1. Object
  2. GraphQLClients

Runtime registry that wires @GraphQLClient-annotated interfaces to the build-time-generated implementations. The generated cn1app.GraphQLClientBootstrap calls register(Class, Factory) for every GraphQL interface in the project; user code reaches them via the static of(String endpoint) factory that cn1:generate-graphql puts on each interface, and that factory in turn calls create(Class, String) here.

Mirrors RestClients and GrpcClients.

Nested types

interface GraphQLClients.FactoryFactory the generated bootstrap registers per API interface.

Methods

public static <T> void register(Class<T> apiType, GraphQLClients.Factory<T> factory)Registers a factory for a @GraphQLClient-annotated interface.
public static <T> T create(Class<T> apiType, String endpoint)Returns a freshly-built client for the requested API bound to endpoint (the GraphQL HTTP endpoint URL).

Inherited methods

Method details

register

public static <T> void register(Class<T> apiType, GraphQLClients.Factory<T> factory)
Registers a factory for a @GraphQLClient-annotated interface.

create

public static <T> T create(Class<T> apiType, String endpoint)
Returns a freshly-built client for the requested API bound to endpoint (the GraphQL HTTP endpoint URL).