Features Apograph CMS on GitHub

Field type reference

Content plugin @apograph/content-server@apograph/content-admin

Every builder, its options, its column, and whether it can be filtered or sorted.

Documents 0.5.2 Updated Edit this page Report a problem

On this page

The narrative version is on fields. This is the lookup table.

Columns generated

BuilderColumnNotes
field.texttext
field.richtextjsonbA document tree, or a legacy HTML string
field.numberdouble precisioninteger when integer: true
field.moneyintegerMinor units — cents
field.booleanbooleanDEFAULT false when required
field.datedateNo time, no zone
field.datetimetimestamptz
field.selecttext
field.multiselectjsonbAn array
field.jsonjsonb
field.mediauuidjsonb array when multiple: true; no foreign key
field.relation<field>_id uuidA join table when many: true; nothing when inverse

Options by builder

BuilderIts own options
textminLength, maxLength, pattern
richtextminLength, maxLength, structure
numbermin, max, integer
moneymin, max (minor units)
select / multiselectoptions
mediamultiple, accept: { kinds, mimeTypes }
relationto, many, onDelete, unique, syncAcrossLocales
relationInverseof, field, many
boolean, date, datetime, json

Every builder also takes required, localized, lang and admin.

Filterable and sortable

BuilderFilterableSortableReached by ?search=
text
richtext
number, money
boolean
date, datetime
select
multiselect
json
media
relationVia a dotted path

Plus the envelope: id, createdAt, updatedAt, publishedAt, and on localized types locale and localeGroupId. On the admin API status is filterable too; on the public API it is not.

Locale behaviour

DeclarationBehaviour on an i18n type
UnmarkedShared — one value for the record, written to every sibling
localized: truePer locale
relation, sync on, non-i18n targetShared — the same target id everywhere
relation, sync on, i18n targetMirrored — resolved to each sibling’s own locale
relation, syncAcrossLocales: falseIndependent per locale
relationInverseNever propagates

Envelope columns

ColumnTypePresent when
iduuidAlways. Primary key.
workspace_iduuidAlways. No foreign key.
created_attimestamptzAlways. Not null.
updated_attimestamptzAlways. Not null.
statustextpublishable: true
published_attimestamptzpublishable: true
deleted_attimestamptzparanoid: true
localetexti18n: true
locale_group_iduuidi18n: true

All nine names are reserved unconditionally, including on types that set neither flag.

Validation

BuilderChecked for
textLength in grapheme clusters, pattern
richtextText length, structural rules
numberRange, whole number
moneyRange, at most two fractional digits
dateShape and a date that exists on the calendar
datetimeISO-8601 with a time component
select / multiselectMembership of options
relation / mediaA uuid, and a target in this workspace

required is a NOT NULL column on a non-publishable type, and a publish-time rule on a publishable one.