import { field } from '@orthacms/content-server/define';
Builders and options
Builder
Own options
field.text
minLength, maxLength, pattern
field.richtext
minLength, maxLength, structure: 'on' | 'off'
field.number
min, max, integer
field.money
min, max (minor units)
field.boolean
—
field.date
—
field.datetime
—
field.select
options (required)
field.multiselect
options (required)
field.json
—
field.media
multiple, accept: { kinds?, mimeTypes? }
field.relation
to (required), many, onDelete, unique, syncAcrossLocales
field.relationInverse
of (required), field (required), many
Every builder also takes:
Option
Notes
required
NOT NULL on a non-publishable type; a publish-time rule on a publishable one
localized
Only on i18n types (boot error otherwise). On a relation, equals syncAcrossLocales: false
lang
Well-formed BCP-47, checked at boot
admin
label, description, placeholder, widget, hidden, group, row, width: 'half' | 'full', plus your own keys
Storage and API types
Builder
Postgres
REST values
GraphQL
text
text
string
String
richtext
jsonb
document object (or legacy string)
JSON
number
double precision; integer with integer: true
number
Float; Int with integer: true
money
integer (minor units)
integer
Float
boolean
boolean (DEFAULT false when required)
boolean
Boolean
date
date
"YYYY-MM-DD"
Date
datetime
timestamptz
ISO-8601 string
DateTime
select
text
string
enum <Type><Field> (String if an option is not a valid name)
multiselect
jsonb array
string[]
[<Type><Field>!]
json
jsonb
any
JSON
media
uuid; jsonb array with multiple — no FK
omitted — ?media=preview
[MediaAsset!]!
relation
<field>_id uuid FK; join table with many; nothing when inverse
omitted — ?relations=preview
target type; <Type><Field>Links { items total } when many/inverse
A relation or media field pointing at a type the workspace cannot reach is
omitted from the GraphQL schema.
Filterable and sortable
Builder
?filter=
?sort=
?search=
text
✅
✅
✅
richtext
—
—
✅
number, money
✅
✅
—
boolean
✅
✅
—
date, datetime
✅
✅
—
select
✅
✅
✅
multiselect
—
—
—
json
—
—
—
media
—
—
—
relation
Via a dotted path (admin)
—
—
Plus the envelope: id, createdAt, updatedAt, publishedAt, and on
localized types locale and localeGroupId. status is filterable on the
admin API only. Sorting defaults to -updatedAt.