Skip to content

findFuncRef

findFuncRef<TCollectionSlug, TPopulate, D>(): FunctionReference<"query", "public", VexFindArgs, FindReturn<TCollectionSlug, TPopulate, D>>

Defined in: packages/core/src/collections/api/networkQuery.ts:213

Casts vexConvexApi.find to the collection/populate/depth-narrowed type for one call site. api.vex.find is one Convex function serving every collection: its registered return type is fixed at codegen from the handler, which only ever sees a runtime collection string — codegen can never narrow it. This re-attaches the per-call-site type (TCollectionSlug/TPopulate/D, all known at the TypeScript call site) by casting the SAME function reference. Sound because the endpoint really does return that collection’s documents: the server find reads rows from that table.

TCollectionSlug extends string

TPopulate extends ContainerPopulateShape<PopulateMapFor<TCollectionSlug>> = Record<string, never>

D extends number = 0

FunctionReference<"query", "public", VexFindArgs, FindReturn<TCollectionSlug, TPopulate, D>>

The find function reference, typed to TCollectionSlug/TPopulate/D.