Skip to main content

Schema Settings

GraphQLSchemaSettings is the base configuration object shared by every endpoint kind. The GCA's GCASchemaSettings extends it, and custom framework endpoints use it directly. Like its subclass, it's built with a fluent builder:

1
GraphQLSchemaSettings.newBuilder()
2
.timeout(Duration.ofSeconds(10))
3
.maximumQueryDepth(12)
4
.build();

Introspection

SettingDefaultDescription
introspectionQueryRule(...)non-production onlyWhether GraphQL introspection (__schema queries) is allowed. The default rule permits introspection everywhere except production. Supply your own IntrospectionQueryRule to customize.

Execution limits

SettingDefaultDescription
timeout(Duration)noneMaximum query execution time. Exceeding it aborts the operation with a timeout error carrying diagnostic extensions.
maximumQueryDepth(Integer)noneMaximum selection-set nesting depth. Introspection queries are exempt. Null or non-positive means unlimited.

Query complexity

SettingDefaultDescription
defaultFieldComplexity(Integer)1Base cost of a field. Fields whose cost differs carry a @complexity(value: ...) directive in the SDL.
addStaticQueryComplexityManager(...)noneBudget enforced before execution based on the query's declared shape.
addDynamicQueryComplexityManager(...)noneBudget enforced during execution based on actual data volume (lists multiply cost).
staticQueryComplexityManagers(List) / dynamicQueryComplexityManagers(List)Replace the full manager lists.

See Security for how complexity works end to end.

SDL output

These control the generated SDL text (as served to tooling and recorded in schema versions):

SettingDescription
excludeDirectiveDefinitionsFromSDL()Omit directive definitions.
excludeDirectivesFromSDL()Omit directive applications on types and fields.
excludeCommentsFromSDL()Omit descriptions/comments.
includeDebugDirectives()Include debugging directives in the schema.
locale(Locale)Locale for generated documentation strings. Defaults to the system locale.

Diagnostics

SettingDescription
profileSchemaLoad()Records detailed timing of schema construction, retrievable from the schema loader. Slows loading—use when debugging slow schema builds, not in steady-state production.

Where settings are applied

An endpoint supplies its settings to its schema loader; the loader bakes them into the generated schema and execution pipeline (instrumentations for timeout, depth, and complexity are installed automatically based on what you configure). Endpoints rebuild their schema when the database environment refreshes or relevant classes are redefined, so settings changes in code take effect on redeploy, and editorial settings changes take effect on publish.

Next steps

Was this page helpful?

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.