Configuration

KGraphQL schema allows configuration of the following properties:

Property Description Default value
useDefaultPrettyPrinter Schema pretty prints JSON responses false
useCachingDocumentParser Schema caches parsed query documents true
documentParserCacheMaximumSize Schema document cache maximum size 1000
objectMapper Schema is using Jackson ObjectMapper from this property result of jacksonObjectMapper() from jackson-kotlin-module
acceptSingleValueAsArray Schema accepts single argument values as singleton list true
coroutineDispatcher Schema is using CoroutineDispatcher from this property CommonPool
executor Executor.Parallel
genericTypeResolver Schema is using generic type resolver from this property GenericTypeResolver.DEFAULT
wrapErrors true
timeout null
introspection Schema allows introspection (also affects SDL). Introspection can be disabled in production to reduce attack surface. true
plugins (unused?)

Example

KGraphQL.schema {
    configure {
        useDefaultPrettyPrinter = true
        objectMapper = jacksonObjectMapper()
        useCachingDocumentParser = false
    }
}