Skip to content

DepthPopulated

DepthPopulated<TCollectionSlug, D> = number extends D ? VexDocument : D extends 0 ? TCollectionSlug extends keyof DocumentBySlug ? DocumentBySlug[TCollectionSlug] : never : TCollectionSlug extends keyof DocumentBySlug ? Prettify<Populated<TCollectionSlug, DepthPopulate<TCollectionSlug, D>>> : never

Defined in: packages/core/src/api/types.ts:479

Return type of find / get / search when depth is provided instead of an explicit populate object.

Delegates to Populated<TCollectionSlug, DepthPopulate<TCollectionSlug, D>> — the same type the explicit populate path produces — so the narrowed shape is identical to what you would get by writing all relationship keys by hand.

Non-literal fallback: number extends D (i.e., D is not a literal) short-circuits to VexDocument to avoid evaluating an infinite recursive type. depth is only called internally with literal values (1), so this only fires when depth comes from a non-literal number variable.

depth: 0 (the default) returns raw un-populated docs — identical to omitting both depth and populate.

TCollectionSlug extends CollectionSlug

The collection slug.

D extends number

The depth literal.