Skip to content

findDraftRow

findDraftRow<DataModel, TCollectionSlug>(props): Promise<VexVersionDocument | null>

Defined in: packages/core/src/versions/model.ts:198

Finds the draft row pointing at a published document, if one exists.

The link is one-directional (design-review §2.3): the published row never carries a pointer back to its draft, so this is the only way to answer “does this document have an active draft” — one indexed lookup, never a scan, and never a reactive subscription touching the published row itself.

DataModel extends GenericDataModel

TCollectionSlug extends string = string

Input props.

TCollectionSlug

The collection slug.

GenericQueryCtx<DataModel> | GenericMutationCtx<DataModel>

A Convex query or mutation context.

Id<TCollectionSlug>

The published row’s _id.

Promise<VexVersionDocument | null>

The draft row whose vex_publishedId equals props.publishedId, or null when the document has no outstanding draft.