Class GraphQl

java.lang.Object
com.jsgalactic.axiom.graphql.GraphQl

public final class GraphQl extends Object
A GraphQL HTTP adapter: an Axiom Handler around a graphql-java runtime.

 var graphql = GraphQl.builder().schema(sdl).graphQL(applicationOwnedGraphQL).build();
 app.post("/graphql", graphql.handler());                    // nothing is served by default
 

The schema is accepted as SDL and parsed when the handler is built, so a bad schema fails at configuration time. The application owns its graphql.GraphQL instance (its runtime wiring, data fetchers and execution strategies) and passes it to GraphQl.Builder.graphQL(Object). The parameter is deliberately typed as Object: no graphql-java type appears in an Axiom signature, and the value is checked when the handler is built. When no instance is supplied the adapter builds a read-only runtime from the SDL with graphql-java's default property fetchers.

The adapter adds its own instrumentation (query depth, query complexity, optional introspection guard and the Axiom deadline) with GraphQL.transform, so the application's instance is never mutated and its own instrumentation is retained. Each request gets a fresh DataLoader registry (optionally filled by the application's own factory) and supports variables and an operation name, and work is bounded by GraphQlOptions. Failures become application/problem+json responses with fixed codes; GraphQL error messages, exception types and stack traces never reach a client. Instances are immutable and thread-safe after construction; an application-owned runtime must be thread-safe too.