Skip to content

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? }.

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.

TCollectionSlug extends string

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

D extends number = 0

VexNetworkQueryClient

Any client exposing query(ref, args).

FindClientArgs<TCollectionSlug, TPopulate, D> & object

{ collection, populate?, depth?, limit?, where?, drafts?, paginationOpts? }.

Promise<DocReturnItem<TCollectionSlug, TPopulate, D>[]>

The matching documents, or a PaginationResult when paginationOpts is given.

const posts = await vexFindQuery(vex, { collection: "posts" });
// ^? Post[]
const withAuthor = await vexFindQuery(vex, {
collection: "posts",
populate: { author: true },
});
// ^? (Post & { author: Author[] })[]

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.

TCollectionSlug extends string

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

D extends number = 0

VexNetworkQueryClient

Any client exposing query(ref, args).

FindClientPaginatedArgs<TCollectionSlug, TPopulate, D>

{ collection, populate?, depth?, limit?, where?, drafts?, paginationOpts? }.

Promise<FindReturnPaginated<TCollectionSlug, TPopulate, D>>

The matching documents, or a PaginationResult when paginationOpts is given.

const posts = await vexFindQuery(vex, { collection: "posts" });
// ^? Post[]
const withAuthor = await vexFindQuery(vex, {
collection: "posts",
populate: { author: true },
});
// ^? (Post & { author: Author[] })[]