DataInitializer type

An async routine that fills extra fields onto a type's own objects before its dependencies load, registered with defineInitializer().

Signature:

export type DataInitializer<T> = (context: any, result: T, fields?: any) => Promise<DataInitializerResult>;

References: DataInitializerResult

Remarks

Its job is to supply what a dependency filter needs but the initial result does not carry — foreign ids that have to be fetched or derived first, for instance. It is handed the resolver context, the objects loaded so far, and the fields the request asked for, and returns a map keyed by object id.

Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.