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.
Type Parameters
Section titled “Type Parameters”DataModel
Section titled “DataModel”DataModel extends GenericDataModel
TCollectionSlug
Section titled “TCollectionSlug”TCollectionSlug extends string = string
Parameters
Section titled “Parameters”Input props.
collection
Section titled “collection”TCollectionSlug
The collection slug.
GenericQueryCtx<DataModel> | GenericMutationCtx<DataModel>
A Convex query or mutation context.
publishedId
Section titled “publishedId”Id<TCollectionSlug>
The published row’s _id.
Returns
Section titled “Returns”Promise<VexVersionDocument | null>
The draft row whose vex_publishedId equals props.publishedId,
or null when the document has no outstanding draft.