Skip to content
module@warp-drive/schema-dsl

Defined in: entities/resource.ts:17

Options accepted by the Resource decorator.

Properties

identityField?

ts
optional identityField?: string;

Defined in: entities/resource.ts:39

The name of the property that serves as this resource's primary key, used only when no property on the class is decorated with id.

Compiles to identity: { kind: '@id', name: identityField }. When omitted (and no id is present), the identity defaults to { kind: '@id', name: 'id' }.


legacy?

ts
optional legacy?: boolean;

Defined in: entities/resource.ts:27

Compiles the class to a LegacyResourceSchema for use with @warp-drive/legacy/model instead of a PolarisResourceSchema.

Legacy resources omit the $type and constructor DerivedFields that Resource otherwise adds automatically.

Released under the MIT License.