Skip to main content

Content Type / ViewModel Introspection

The GCA provides an Introspect operation for programmatic discovery of the content types and view models in your schema, returning structured metadata about types, fields, and capabilities. This goes beyond standard GraphQL introspection by exposing Brightspot's type system—ObjectType and ObjectField metadata like internal names, display names, indexes, and groupings—rather than just the generated GraphQL types.

Introspection is the foundation for dynamic tools: schema explorers, automatic form generators, query builders, documentation generators, or any application that adapts to schema changes without hardcoding type information.

Configuration

Type-system introspection is off by default. Enable it explicitly:

1
GCASchemaSettings.newBuilder()
2
.readonlyEntryClass(Article.class)
3
.allowTypeSystemIntrospection()
4
.build();
Two kinds of introspection

This setting is independent of standard GraphQL introspection (__schema queries), which is governed by introspectionQueryRule(...) and allowed only in non-production environments by default. allowTypeSystemIntrospection() adds the Brightspot-specific Introspect entry field described here. See Security.

Anatomy of the Introspect operation

The Introspect root field exposes two branches:

FieldDescription
RecordIntrospect content types: ObjectType and ObjectField metadata.
ViewIntrospect view models, mirroring the Record branch for view types.

The Record branch provides:

FieldArgumentsDescription
typesgroup: StringAll introspectable types, optionally filtered by ObjectType group.
typewith (one-of)A single type, looked up by id (UUID), name (internal name), or class (Java class name).
globalsThe global fields available on all types.

Examples

List every type in the schema:

1
{
2
Introspect {
3
Record {
4
types {
5
_id
6
}
7
}
8
}
9
}

Look up a single type by its Java class and explore its fields:

1
query TypeByClass($with: ObjectTypeSchemaGetTypeInput!) {
2
Introspect {
3
Record {
4
type(with: $with) {
5
_id
6
}
7
}
8
}
9
}
1
{ "with": { "class": "com.example.Article" } }

The returned objects are Brightspot's own ObjectType records, so the metadata you can select—field definitions, display names, internal names, groups—is the same metadata that powers the CMS itself. Restrict results to a subset using types(group: "...") with any ObjectType group name.

Introspection and field filters

Introspection results respect your endpoint configuration: types and fields excluded by your fieldFilter or not reachable from your entry types do not appear. This means a query builder built on Introspect automatically reflects exactly what its users are allowed to query—no separate permission model to maintain.

Discovering queryable fields from SDL

For lighter-weight needs, remember that the generated schema is self-describing even without the Introspect operation: every field carries a @bsp_field / @bsp_method directive with its internal name and an indexed flag marking predicate-eligible fields. See Content Schema Types.

Next steps

Was this page helpful?

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