Skip to content

PopulateMapEntry

PopulateMapEntry = { kind: "relationship" | "upload"; scalar?: true; target: string; } | { fields: Record<string, PopulateMapEntry>; kind: "group"; } | { blocks: Record<string, Record<string, PopulateMapEntry>>; kind: "blocks"; } | { discriminator: string; kind: "variant"; variants: Record<string, Record<string, PopulateMapEntry>>; } | { kind: "record"; value: PopulateMapEntry; }

Defined in: packages/core/src/types/generated.ts:365

One field’s entry in CollectionsPopulateMap — mirrors the field tree down through group()/array()/blocks() boundaries that CollectionsFieldTypeMap stops at (it only indexes getDataFields’s flat, top-level-per-container output).

  • relationship / upload — a leaf: target is the collection the field’s ids resolve against.
  • group — fields is this group’s OWN nested populate map (same shape as a collection’s top-level map).
  • blocks — blocks is keyed by each block’s blockType slug, each value that block’s own nested populate map.
  • record — a keyValue() field; value is the ONE shared entry every record key’s stored value is populated against (the same entry, applied to every dynamically-keyed entry — unlike group/blocks, there is no static per-key map to express).

array() never appears here: its own entry (built by fieldsToPopulateMap) IS its items field’s entry — an array of relationship ids behaves like the relationship field itself, an array of group() items behaves like the group.