Class GraphQL.Builder

java.lang.Object
com.codename1.backend.graphql.GraphQL.Builder
Enclosing class:
GraphQL

public static final class GraphQL.Builder extends Object
Builds a GraphQL.
  • Method Details

    • fetcher

      public GraphQL.Builder fetcher(String typeName, String fieldName, DataFetcher fetcher)

      Resolves typeName.fieldName with fetcher.

      Throws
      • IllegalArgumentException: when the schema has no such field, or the field already has a resolver -- the build reports the same as errors, as Spring for GraphQL's schema inspection does
    • batchLoader

      public GraphQL.Builder batchLoader(String typeName, String fieldName, GraphQL.BatchLoader loader)

      Resolves typeName.fieldName for many sources at once with loader.

      Throws
    • typeResolver

      public GraphQL.Builder typeResolver(String typeName, TypeResolver resolver)
      Names the object type of values of the interface or union typeName.
    • scalar

      public GraphQL.Builder scalar(String typeName, GraphQLScalar scalar)
      Coerces the custom scalar typeName with scalar.
    • introspection

      public GraphQL.Builder introspection(boolean enabled)
      Whether __schema and __type answer; on by default, as in Spring for GraphQL (spring.graphql.schema.introspection.enabled).
    • maxFields

      public GraphQL.Builder maxFields(int fields)
      The deepest nesting of selection sets a document may have; 15 by default. A deeper document is refused before it runs, which bounds what one request can make the server do. The most fields one document may select, counting every alias and every place a fragment is spread; 2000 unless set. A document over it is refused before anything runs.
    • maxDepth

      public GraphQL.Builder maxDepth(int depth)
    • rootValue

      public GraphQL.Builder rootValue(Object value)
      The source the root fields' resolvers are given; null by default.
    • build

      public GraphQL build()
      The engine.