Interface DerivedField
Defined in: warp-drive-packages/core/src/types/schema/fields.ts:958
Represents a field whose value is derived from other fields in the schema.
The value is read-only, and is not stored in the cache, nor is it sent to the server.
Usage of derived fields should be minimized to scenarios where the derivation is known to be safe. For instance, derivations that required fields that are not always loaded or that require access to related resources that may not be loaded should be avoided.
Properties
kind
kind: "derived";Defined in: warp-drive-packages/core/src/types/schema/fields.ts:964
The kind of field this is.
name
name: string;Defined in: warp-drive-packages/core/src/types/schema/fields.ts:971
The name of the field.
options?
optional options?: ObjectValue;Defined in: warp-drive-packages/core/src/types/schema/fields.ts:1002
Options to pass to the derivation, if any
Must comply to the specific derivation's options schema.
type
type: string;Defined in: warp-drive-packages/core/src/types/schema/fields.ts:992
The name of the derivation to use.
Derivations are functions that take the record, options, and the name of the field as arguments, and return the derived value.
Derivations are memoized, and are only recomputed when the fields they depend on change.
Derivations are not stored in the cache, and are not sent to the server.
Derivation functions must be explicitly registered with the schema service.