Skip to content

relationshipValidator

relationshipValidator<TCollectionSlug>(slug, fn): FieldValidate<TCollectionSlug, string[]>

Defined in: packages/core/src/fields/relationship/validator.ts:45

Types a relationship() field’s validate() against a real collection and DataModel, with value fixed to string[] (serialized Id[]).

TCollectionSlug extends string

TCollectionSlug

The owning collection’s slug, used only to infer TCollectionSlug.

FieldValidate<TCollectionSlug, string[], RelationshipField<string, { }, string, ComponentHKT>>

The validate callback, checked against the collection’s real document shape and value type.

FieldValidate<TCollectionSlug, string[]>

The same function, re-typed to the field’s loose public validate signature.

fieldValidator