Skip to main content

GCA Schema Settings Reference

GCASchemaSettings is the single configuration object that drives GCA schema generation. Build it with GCASchemaSettings.newBuilder(), chain the settings you need, and return it from your endpoint's getSchemaSettings() method:

1
import java.util.Set;
2
3
import com.psddev.dari.db.Recordable;
4
import com.psddev.dari.db.Singleton;
5
import com.psddev.graphql.gca.GCAEndpoint;
6
import com.psddev.graphql.gca.GCASchemaSettings;
7
8
@Recordable.DisplayName("My First GCA Endpoint")
9
public class MyFirstGCAEndpoint extends GCAEndpoint implements Singleton {
10
11
@Override
12
public Set<String> getPaths() {
13
return Set.of("/my-first-gca");
14
}
15
16
@Override
17
protected GCASchemaSettings getSchemaSettings() {
18
return GCASchemaSettings.newBuilder()
19
.build();
20
}
21
}

This page catalogs every builder setting, grouped by purpose. Unless noted otherwise, boolean settings default to off and are enabled by calling the method with no arguments.

tip

Almost everything here is also configurable through the CMS UI—see Editorial Endpoint Configuration.

Entry types

The foundation of the schema: which content types are exposed, and with what access level.

SettingDescription
readonlyEntryClass(Class) / readonlyEntryTypes(...)Expose a type (and its concrete subtypes) for Get and Query. Class, ObjectType, varargs, and collection variants exist.
mutableEntryClass(Class) / mutableEntryTypes(...)Expose a type with full read-write access, enabling content mutations. Mutable types are automatically readable.
entryViewClass(Class) / entryViewClasses(...)Register content-backed view models.
endpointViewType(OperationType, Class) / endpointViewTypes(...)Register standalone (endpoint-backed) view models under the query or mutation root.

Entry field shape

How the root Get and Query fields are generated.

SettingDescription
includeTypeSpecificEntryFields()Adds strongly-typed per-type fields (Get/Type/Article, Query/From/Article) alongside the generic Record/Records fields. Grows the schema proportionally to your type count.
includeAbstractSubtypesInQueryEntryFields()Also adds entry fields for shared abstract supertypes so consumers can query sibling types together. Requires type-specific entry fields.
onlyIncludeExplicitEntryFields()Only explicitly-configured types become entry fields—supertypes don't fan out into their subtypes. Requires type-specific entry fields.
allowQueriesOnSingletonEntryFields()Lets Singleton types appear in query entry fields. By default they're only fetchable via Get/Singleton.
includeImplicitViewEntryFields()Auto-includes compatible view types that weren't explicitly registered. A workaround setting; prefer explicit registration.

Query behavior

SettingDefaultDescription
defaultQueryLimit(int)10Limit applied when a query specifies none.
maximumQueryLimit(int)200Largest limit a caller may request.
maximumQueryTimeout(Double)noneCaps the per-query options.timeout (seconds).
allowGroupByQueries()offEnables groupBy. Changes entry-field return types to unions—a breaking schema change.
onlyAllowUniqueIndexLookups()offRemoves arbitrary querying; only single-object fetches by ID, unique index, or permalink remain.
disallowQueryFieldExecution()offQuery-typed fields on records expose their metadata (predicate, sorts) but can't be executed/traversed.
filterVisibilityUnawareQueriesInMemory()offFilters invisible records in memory for queries that can't express visibility as a predicate. Only pageInfo.hasNext stays reliable; reserve for small datasets.

Mutations

SettingDescription
contentActionType(Class) / contentActionTypes(...)Expose specific write actions (SaveActionDefinition, PublishActionDefinition, ArchiveActionDefinition, RestoreActionDefinition, DeleteActionDefinition, WorkflowActionDefinition, or custom WriteOperationDefinition implementations).
contentActionTypesAll()Auto-discover and expose every available write action.

Editorial features on Get

SettingDescription
includeGetRevision()Adds the Revision field—revision history (History, drafts, workflow logs).
includeGetPreview()Adds the Preview field—shared previews, including previewing through views.
includeGetOverlay()Adds the Overlay field—overlay/variation data (requires plugin).
includeGetDerivation()Adds the Derivation field—derived content such as translations (requires plugin).

State and view access

SettingDescription
allowRawStateAccess()Adds _raw (raw state JSON) to every record type. Bypasses all field filters.
allowRawViewAccess()Adds _raw (view as JSON map) to every view type. Resolves the entire view; beware cycles.
excludeTypeNamesFromRawView()Strips type/class names from _raw view output.
includeModelOnViews()Adds _model to view types for access to the backing record.
disallowAllStateAccess()CDA mode. Removes all record state access—State, queries, and mutations—leaving only views (and explicitly registered static methods). Implies onlyAllowUniqueIndexLookups() and negates the editorial Get features above.
inlineModificationFieldsWhenOnlyOneTypeExists()Flattens single-modification Mod types onto their parent. Adding a second modification later breaks the inlined queries.
disallowNullCollectionItems()Filters nulls out of collections and marks items non-null in the schema.

Methods

SettingDescription
staticMethod(OperationType, Method) / staticMethod(OperationType, String, Method)Expose a static method as an Execute field, optionally aliased.
staticMethods(OperationType, Class) / staticMethods(OperationType, Collection)Expose all (or a set of) public static methods.
instanceMethod(Method) / instanceMethods(...)Attach public instance methods as fields on their declaring record types.

Runtime context suppliers

Functions evaluated per request (or at schema load, for themes) that connect the endpoint to Brightspot's editorial model.

SettingDescription
siteSupplier(...)Supplies the current Site. Queries filter to site-accessible content; mutations assign new content's owner and reject inaccessible targets. Also switches URL lookups to site-relative _path.
toolUserSupplier(...)Supplies the ToolUser for save attribution (publish/update user)—which also enables History revision creation.
impersonatedToolUserSupplier(...)Supplies an impersonated user for saves. Explicitly setting null (when a tool user supplier exists) instead adds a toolUser argument to mutations.
themeSupplier(...)Supplies the Theme, adding strongly-typed theme/style fields. Theme changes invalidate the schema.

Filters and naming

SettingDefaultDescription
fieldFilter(...)allow allPredicate deciding which ObjectFields appear in the schema. Receives divergent fields with their instantiable parent type.
referenceTypeFilter(...)deny allPredicate deciding which types may be resolved through reference fields. Entry types are always resolvable; denied references return RecordRef.
richTextElementTypeFilter(...)allow allPredicate deciding which rich text element types are included.
objectTypeTypeNameFunction(...)built-inCustom GraphQL names (with fallbacks) for content types.
viewInterfaceTypeNameFunction(...)built-inCustom GraphQL names for view types.
excludeOuterClassInTypeNamePredicate(...)noneWhether inner classes' outer class names are dropped from generated names.

Introspection, complexity, and security

SettingDefaultDescription
allowTypeSystemIntrospection()offAdds the Introspect operation.
embeddedFieldComplexity(Integer)inheritComplexity points charged for embedded record fields.
referenceFieldComplexity(Integer)inheritComplexity points charged for reference fields (these cost database fetches).
verboseClientErrors()offDetailed execution errors for clients. May expose sensitive data—development only.
strictMode()offValidate settings at build() and throw on invalid input instead of silently omitting it.

Documentation

SettingDescription
docsSearchProvider(...)Links schema elements to an external documentation search.
javadocsProvider(...)Links schema elements to hosted Javadocs.

Inherited settings

GCASchemaSettings extends the core GraphQLSchemaSettings, shared by all endpoint kinds (GCA, code generator, framework). The inherited surface—introspection rules, query timeout, maximum depth, complexity managers, SDL output options, locale, schema-load profiling—is documented in the common Schema Settings reference.

Endpoint-level configuration

A few concerns live on GCAEndpoint rather than the settings object:

MethodDescription
getPaths()The URL paths serving this endpoint.
getSchemaSettings()Returns the settings built above.
getApiAccessOption()Access control; defaults to requiring an API key. See Security.
updateCorsConfiguration(...)Adjust CORS origins/headers.

The endpoint's schema automatically reloads when the database environment refreshes or when Recordable / ViewModel classes are redefined.

Was this page helpful?

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