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

Interface ResourceOptions ​

ts
interface ResourceOptions {
  identityField?: string;
  legacy?: boolean;
}

Defined in: entities/resource.ts:19

Options accepted by the Resource decorator.

Properties ​

identityField? ​

ts
identityField?: string;

Defined in: entities/resource.ts:41

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
legacy?: boolean;

Defined in: entities/resource.ts:29

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.