Skip to main content

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):

OptionTypeDescription
hiddenbooleanNever returned, even if explicitly requested in projection.
exclusivebooleanOnly 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;