# 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`.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static interface`
  `GraphQLClients.Factory<T>`
  Factory the generated bootstrap registers per API interface.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `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).
  `static <T> void`
  `register(Class<T> apiType, GraphQLClients.Factory<T> factory)`
  Registers a factory for a `@GraphQLClient`-annotated interface.

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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