SchemaCompiler

class SchemaCompiler(mappedScalars: Map<String, String> = emptyMap())(source)

Compiles a GraphQL schema IDL string into an executable GraphQLSchema using graphql-java's IDL tools. Primarily used for validating GraphQL operation documents against the schema during code generation.

Custom scalars that are not part of the built-in GraphQL specification scalars (String, Int, Float, Boolean, ID) are wired with pass-through coercing so the schema can be built without external scalar implementations.

Parameters

mappedScalars

Optional mapping of custom scalar names to their Kotlin type names. Reserved for future use; not currently consumed by the compiler.

Constructors

Link copied to clipboard
constructor(mappedScalars: Map<String, String> = emptyMap())

Functions

Link copied to clipboard
fun compile(schemaIdl: String): GraphQLSchema

Builds a graphql-java GraphQLSchema from a schema IDL string.

Link copied to clipboard
fun validate(schema: GraphQLSchema, operationDocument: String): ValidationResult

Validates a GraphQL operation document string against the compiled schema.