Skip to content
module@warp-drive/core/types/schema/fields

Interface LegacyAttributeField ​

Defined in: warp-drive-packages/core/src/types/schema/fields.ts:1258

CAUTION

This Field is LEGACY It cannot be used with PolarisMode

A generic "field" that can be used to define primitive value fields.

If the field points to an object or array, it will not be deep-tracked.

Transforms when defined are legacy transforms that a serializer might use, but their usage is not guaranteed.

Properties ​

kind ​

ts
kind: "attribute";

Defined in: warp-drive-packages/core/src/types/schema/fields.ts:1264

The kind of field this is.


name ​

ts
name: string;

Defined in: warp-drive-packages/core/src/types/schema/fields.ts:1271

The name of the field.


options? ​

ts
optional options?: AttrOptions;

Defined in: warp-drive-packages/core/src/types/schema/fields.ts:1311

Options to pass to the transform, if any

Must comply to the specific transform's options schema.

See AttrOptions for more info.


sourceKey? ​

ts
optional sourceKey?: string;

Defined in: warp-drive-packages/core/src/types/schema/fields.ts:1295

The name of the field as returned by the API and inserted into the Cache if it differs from LegacyAttributeField.name

For instance, if the API returns:

ts
{
  attributes: {
    'first-name': 'Chris'
  }
}

But the app desires to use record.firstName; // 'Chris'

Then name would be set to 'firstName' and sourceKey would be set to 'first-name'.

This option is only needed when the value differs from name.


type? ​

ts
optional type?: string | null;

Defined in: warp-drive-packages/core/src/types/schema/fields.ts:1302

The name of the transform to use, if any

Released under the MIT License.