Class GraphQLClients

java.lang.Object
com.codename1.io.graphql.GraphQLClients

public final class GraphQLClients extends Object

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.

  • 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).