type
Field
The resolved contract for one field.
Properties
| Property | Type | Description |
|---|---|---|
ID | StableID | The ID value. |
Name | string | The Name value. |
Path | query.Path | The Path value. |
Type | FieldType | The Type value. |
Category | FieldCategory | The Category value. |
Required | bool | The Required value. |
Unique | bool | The Unique value. |
Index | bool | The Index value. |
Localized | bool | The Localized value. |
QueryRestricted | bool | QueryRestricted records an attached read policy's static prohibition on caller filtering, sorting and distinct queries. It is not an access verdict. |
Default | *string | The Default value. |
DynamicDefault | bool | DynamicDefault permits omitted input to reach server initialization. It does not contain executable code or promise that the callback supplies a value. |
LiveValidation | bool | LiveValidation enables explicit advisory server feedback without serializing callbacks. |
Admin | FieldAdmin | The Admin value. |
Text | *TextField | The Text value. |
Textarea | *TextField | The Textarea value. |
Code | *CodeField | The Code value. |
Number | *NumberField | The Number value. |
Date | *DateField | The Date value. |
Select | *SelectField | The Select value. |
Point | *PointField | The Point value. |
UI | *UIField | The UI value. |
Join | *JoinField | The Join value. |
Virtual | *VirtualField | The Virtual value. |
Relationship | *RelationshipField | The Relationship value. |
List | *PrimitiveListField | Item-count constraints for text and number lists; Text or Number carries their element constraints. |
Upload | *UploadField | The Upload value. |
Nested | *NestedField | The Nested value. |
Blocks | *BlocksField | The Blocks value. |
Plugin | *PluginField | The Plugin value. |
How it works
Typed kinds carry their matching detail: Text, Textarea, Code, Number, Date, Select, Point, UI, Join, Virtual, Relationship, Upload, Nested, Blocks, or Plugin. Primitive lists carry List plus Text or Number for element constraints. Checkbox, email, and simple JSON fields need no extra detail.
Full signature
type Field struct {
ID StableID `json:"id"`
Name string `json:"name"`
Path query.Path `json:"path"`
Type FieldType `json:"type"`
Category FieldCategory `json:"category"`
Required bool `json:"required"`
Unique bool `json:"unique"`
Index bool `json:"index,omitempty"`
Localized bool `json:"localized,omitempty"`
// QueryRestricted records an attached read policy's static prohibition on
// caller filtering, sorting and distinct queries. It is not an access verdict.
QueryRestricted bool `json:"queryRestricted,omitempty"`
Default *string `json:"default,omitempty"`
// DynamicDefault permits omitted input to reach server initialization. It does
// not contain executable code or promise that the callback supplies a value.
DynamicDefault bool `json:"dynamicDefault,omitempty"`
// LiveValidation enables explicit advisory server feedback without serializing callbacks.
LiveValidation bool `json:"liveValidation,omitempty"`
Admin FieldAdmin `json:"admin"`
Text *TextField `json:"text,omitempty"`
Textarea *TextField `json:"textarea,omitempty"`
Code *CodeField `json:"code,omitempty"`
Number *NumberField `json:"number,omitempty"`
Date *DateField `json:"date,omitempty"`
Select *SelectField `json:"select,omitempty"`
Point *PointField `json:"point,omitempty"`
UI *UIField `json:"ui,omitempty"`
Join *JoinField `json:"join,omitempty"`
Virtual *VirtualField `json:"virtual,omitempty"`
Relationship *RelationshipField `json:"relationship,omitempty"`
List *PrimitiveListField `json:"list,omitempty"`
Upload *UploadField `json:"upload,omitempty"`
Nested *NestedField `json:"nested,omitempty"`
Blocks *BlocksField `json:"blocks,omitempty"`
Plugin *PluginField `json:"plugin,omitempty"`
}