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

Interface BelongsToOptions ​

ts
interface BelongsToOptions {
  as?: string;
  async?: boolean;
  inverse: string | null;
  polymorphic?: boolean;
  sourceKey?: string;
  type: string;
}

Defined in: fields/belongs-to.ts:12

Options accepted by the belongsTo decorator.

Properties ​

as? ​

ts
as?: string;

Defined in: fields/belongs-to.ts:51

If this field is polymorphic, the trait or abstract type that this resource implements.


async? ​

ts
async?: boolean;

Defined in: fields/belongs-to.ts:34

Whether the relationship is async. Compiles onto the LegacyBelongsToField's options.async, defaulting to false.


inverse ​

ts
inverse: string | null;

Defined in: fields/belongs-to.ts:26

The name of the inverse field on the related resource, or null if the relationship is unidirectional.


polymorphic? ​

ts
polymorphic?: boolean;

Defined in: fields/belongs-to.ts:43

Whether this field satisfies a polymorphic relationship on another resource, meaning it can point to multiple types of resources so long as they implement the trait or abstract type named by type.


sourceKey? ​

ts
sourceKey?: string;

Defined in: fields/belongs-to.ts:59

The name of the field as returned by the API, if it differs from the decorated property's name.


type ​

ts
type: string;

Defined in: fields/belongs-to.ts:18

The name of the related resource's type.

Released under the MIT License.