AssociationFieldOptions
The options object accepted by @Link(). See
Associations for the full guide.
type AssociationFieldOptions = Partial<
Omit<AssociationFieldMetadata, 'entity' | 'name' | 'kind' | 'association'>
>;
In practice this is just the hidden/exclusive pair every field kind shares (there is no
association-specific option beyond that — the join/eager-fetch shape itself is configured via the
.toOne()/.toMany() call, not here):
| Option | Type | Description |
|---|---|---|
hidden | boolean | Never returned, even if explicitly requested in projection. |
exclusive | boolean | Only returned when explicitly requested in projection — used on essentially every @Link field in practice, since eagerly resolving every relation by default would be expensive. See Repositories → Projection. |
@Link({ exclusive: true })
declare readonly country?: Country;