Skip to content

GlobalAfterChangeProps

Defined in: packages/core/src/globals/hooks.ts:28

Arguments passed to a global’s afterChange hook.

Fires for EVERY vex_globals row write of this global, draft rows included — newDoc.vex_status (present when the global declares versions.drafts: true) tells a draft save from a publish. operation describes the ROW: the first Save Draft after a publish inserts a new draft row, so it arrives as "create" even though the global existed.

TGlobalSlug extends GlobalSlug = GlobalSlug

TDataModel extends GenericDataModel = GenericDataModel

commitTs: unknown

Defined in: packages/core/src/hooks/types.ts:29

This write’s unresolved ctx.db.vars.commitTs placeholder — the same value stampCommitTsFields writes into a matching commitTs() field. A hook MAY use it to stamp a RELATED document in the same mutation (e.g. a parent row’s own commitTs field). It is NOT the resolved value — Convex resolves a commitTs placeholder only after the mutation commits, so reading it as a number/bigint here throws or returns the placeholder object itself, never a usable timestamp.

BaseHookProps.commitTs


ctx: GenericMutationCtx<TDataModel>

Defined in: packages/core/src/hooks/types.ts:19

BaseHookProps.ctx


global: GlobalConfig<{ }, { }, TGlobalSlug>

Defined in: packages/core/src/globals/hooks.ts:40

The resolved config of the global this write ran on.


id: string

Defined in: packages/core/src/globals/hooks.ts:34

The written vex_globals row’s _id.


newDoc: DocumentByGlobalSlug<TGlobalSlug>

Defined in: packages/core/src/globals/hooks.ts:38

Flat document after the write (flattenGlobalRow).


oldDoc: DocumentByGlobalSlug<TGlobalSlug> | null

Defined in: packages/core/src/globals/hooks.ts:36

Flat document before the write (flattenGlobalRow), or null on insert.


operation: "create" | "update"

Defined in: packages/core/src/globals/hooks.ts:32