Skip to main content

Interface: QueryCtx<DataModel>

server.QueryCtx

A set of services for use within Convex query functions.

The query context is passed as the first argument to any Convex query function run on the server.

This differs from the MutationCtx because all of the services are read-only.

If you're using code generation, use the QueryCtx type in convex/_generated/server.d.ts which is typed for your data model.

Type parameters

NameType
DataModelextends GenericDataModel

Properties

db

db: DatabaseReader<DataModel>

A utility for reading data in the database.

Defined in

server/registration.ts:76


auth

auth: Auth

Information about the currently authenticated user.

Defined in

server/registration.ts:81


storage

storage: StorageReader

A utility for reading files in storage.

Defined in

server/registration.ts:86