vexFindQuery
Implementation signature for the two vexFindQuery overloads above — not
called directly with this shape. See the overloads for the public contract.
client
Any client exposing query(ref, args).
args
{ collection, populate?, depth?, limit?, where?, drafts?, paginationOpts? }.
Call Signature
Section titled “Call Signature”vexFindQuery<
TCollectionSlug,TPopulate,D>(client,args):Promise<DocReturnItem<TCollectionSlug,TPopulate,D>[]>
Defined in: packages/core/src/collections/api/networkQuery.ts:315
Finds documents in a collection via a direct network call — any client
exposing a plain query(ref, args) method (VexServerClient from
@vexcms/next, ConvexHttpClient, ConvexReactClient). Typed to the
document of the collection slug passed in, populated per populate/depth,
with zero casts at the call site.
For TanStack Query / React, use find() from @vexcms/react/client instead
— same typing, wrapped as query options.
Type Parameters
Section titled “Type Parameters”TCollectionSlug
Section titled “TCollectionSlug”TCollectionSlug extends string
TPopulate
Section titled “TPopulate”TPopulate extends ContainerPopulateShape<PopulateMapFor<TCollectionSlug>> = Record<string, never>
D extends number = 0
Parameters
Section titled “Parameters”client
Section titled “client”Any client exposing query(ref, args).
FindClientArgs<TCollectionSlug, TPopulate, D> & object
{ collection, populate?, depth?, limit?, where?, drafts?, paginationOpts? }.
Returns
Section titled “Returns”Promise<DocReturnItem<TCollectionSlug, TPopulate, D>[]>
The matching documents, or a PaginationResult when paginationOpts is given.
Example
Section titled “Example”const posts = await vexFindQuery(vex, { collection: "posts" });// ^? Post[]
const withAuthor = await vexFindQuery(vex, { collection: "posts", populate: { author: true },});// ^? (Post & { author: Author[] })[]Call Signature
Section titled “Call Signature”vexFindQuery<
TCollectionSlug,TPopulate,D>(client,args):Promise<FindReturnPaginated<TCollectionSlug,TPopulate,D>>
Defined in: packages/core/src/collections/api/networkQuery.ts:323
Finds documents in a collection via a direct network call — any client
exposing a plain query(ref, args) method (VexServerClient from
@vexcms/next, ConvexHttpClient, ConvexReactClient). Typed to the
document of the collection slug passed in, populated per populate/depth,
with zero casts at the call site.
For TanStack Query / React, use find() from @vexcms/react/client instead
— same typing, wrapped as query options.
Type Parameters
Section titled “Type Parameters”TCollectionSlug
Section titled “TCollectionSlug”TCollectionSlug extends string
TPopulate
Section titled “TPopulate”TPopulate extends ContainerPopulateShape<PopulateMapFor<TCollectionSlug>> = Record<string, never>
D extends number = 0
Parameters
Section titled “Parameters”client
Section titled “client”Any client exposing query(ref, args).
FindClientPaginatedArgs<TCollectionSlug, TPopulate, D>
{ collection, populate?, depth?, limit?, where?, drafts?, paginationOpts? }.
Returns
Section titled “Returns”Promise<FindReturnPaginated<TCollectionSlug, TPopulate, D>>
The matching documents, or a PaginationResult when paginationOpts is given.
Example
Section titled “Example”const posts = await vexFindQuery(vex, { collection: "posts" });// ^? Post[]
const withAuthor = await vexFindQuery(vex, { collection: "posts", populate: { author: true },});// ^? (Post & { author: Author[] })[]