GenericQueryClientParams
Defined in: packages/core/src/api/types.ts:161
Base shape for client-side args of a vex.* query function.
Carries the ctx?: never discriminator (forbids passing a Convex query
context) and the populate field, since every query function that returns
documents supports relationship population (the only outlier is count,
which returns a number and overrides populate?: never).
Function-specific args interfaces extend this and add their own per-function
fields. limit stays per-function because it doesn’t apply to single-doc
queries (get) or scalar queries (count).
Example
Section titled “Example”Inheritance pattern
// find — adds slug + limit; populate inheritedinterface FindClientArgs<TCollectionSlug, TPopulate> extends GenericQueryClientParams<TCollectionSlug, TPopulate> { slug: TCollectionSlug; limit?: number;}
// get — adds id; populate inherited; no limit (single-doc)interface GetClientArgs<TCollectionSlug, TPopulate> extends GenericQueryClientParams<TCollectionSlug, TPopulate> { id: GenericId<TCollectionSlug>;}
// search — adds slug + query + index fields + limit; populate inheritedinterface SearchClientArgs<TCollectionSlug, TPopulate> extends GenericQueryClientParams<TCollectionSlug, TPopulate> { slug: TCollectionSlug; query: string; searchIndexName: string; searchField: string; limit?: number;}
// count — returns a number, has no docs to populate; overrides populateinterface CountClientArgs<TCollectionSlug> extends GenericQueryClientParams<TCollectionSlug> { slug: TCollectionSlug; populate?: never;}Extended by
Section titled “Extended by”Type Parameters
Section titled “Type Parameters”TCollectionSlug
Section titled “TCollectionSlug”TCollectionSlug extends CollectionSlug = CollectionSlug
The collection slug; used to narrow populate keys via
RelationshipKeysOf<TCollectionSlug>. Defaults to the full CollectionSlug union.
TPopulate
Section titled “TPopulate”TPopulate extends PopulateShape<TCollectionSlug> = Record<string, never>
The populate object. Defaults to
Record<string, never> (no relationships populated).
D extends number = number
Properties
Section titled “Properties”
optionalauth?:undefined
Defined in: packages/core/src/api/types.ts:167
Discriminator: client args MUST NOT supply auth.
optionalctx?:undefined
Defined in: packages/core/src/api/types.ts:169
Discriminator: client args MUST NOT supply ctx.
depth?
Section titled “depth?”
optionaldepth?:D
Defined in: packages/core/src/api/types.ts:183
Auto-populate all relationship fields to this many levels.
Inferred as the literal D so a wrapper that threads D through to its
return type narrows accordingly (depth: 2 → depth-populated doc). A
non-literal number degrades to VexDocument via DepthPopulated’s
guard. D defaults to number, so wrappers that do not thread it keep the
plain passthrough they had before.
Use populate for documented consumer code; depth is internal.
populate?
Section titled “populate?”
optionalpopulate?:TPopulate
Defined in: packages/core/src/api/types.ts:171
Recursive populate object, type-narrowed against RelationshipKeysOf<TCollectionSlug>.
optionalskip?:boolean
Defined in: packages/core/src/api/types.ts:189
When true, the wrapper passes convexQuery’s "skip" sentinel instead of
args, so the query is not issued. Use for conditional queries (e.g. an id
that is not known yet) without violating the Rules of Hooks.