isoDates() function
Build the query extension that serializes every Date in a query result to an ISO-8601 string.
Signature:
export declare function isoDates(): (client: any) => import("@prisma/client/extension").PrismaClientExtends<import("@prisma/client/runtime/client").InternalArgs<{}, {}, {}, {}>>;
Returns:
(client: any) => import("@prisma/client/extension").PrismaClientExtends<import("@prisma/client/runtime/client").InternalArgs<{}, {}, {}, {}>>
A Prisma extension to pass to client.$extends().
Remarks
The generated @imqueue/rpc models type Prisma's DateTime as string (the codegen scalars config decides this), so a service that returned Prisma's own Date objects would be handing callers a shape its own types disagree with. This extension closes that gap at the boundary rather than at every call site.
Conversion walks the whole result recursively — arrays, nested objects and relations included — and leaves structure and every non-Date value untouched. It applies to results only: Date values you pass IN as query arguments are still handed to Prisma as Date.
Example
const client = new PrismaClient().$extends(isoDates());
Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.