Skip to main content

Content Types

Content models are the primary way to expose and query data from your Brightspot instance through the GCA. By configuring your Java content types (classes that extend Content or implement Recordable), you can automatically generate GraphQL operations for fetching, querying, and mutating your content without writing custom schema definitions. The GCA provides three core operations for working with content models:

Get — fetch single items by ID, URL, or unique field, with access to editorial features like revisions and previews.

Query — retrieve collections with filtering, sorting, pagination, and group-by aggregation that mirror the Dari Query API.

Mutations — create, update, publish, archive, and delete content, including file uploads, embedded records, and transactions.

All three operations share the same response types, which are detailed in the Content Schema Types reference.

The examples throughout this section use a small Article / Author domain model and the following endpoint configuration as a starting point:

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("Content API")
9
public class ContentApiEndpoint extends GCAEndpoint implements Singleton {
10
11
@Override
12
public Set<String> getPaths() {
13
return Set.of("/content-api");
14
}
15
16
@Override
17
protected GCASchemaSettings getSchemaSettings() {
18
return GCASchemaSettings.newBuilder()
19
.readonlyEntryClass(Article.class)
20
.readonlyEntryClass(Author.class)
21
.includeTypeSpecificEntryFields()
22
.includeGetRevision()
23
.includeGetPreview()
24
.build();
25
}
26
}

Was this page helpful?

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