# isoDates() function · @imqueue/pg-prisma

Source: https://imqueue.org/api/pg-prisma/latest/pg-prisma.isodates/
Published: 2026-08-01
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/pg-prisma 1.0.1 — generated reference, not hand-written

Build the query extension that serializes every `Date` in a query result to an ISO-8601 string.

**Signature:**

```typescript
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


```typescript
const client = new PrismaClient().$extends(isoDates());
```

