Repository navigation
Closed
Labels
kind/bugA reported bug.
Description
Bug description
It looks like cursor pagination of nested relations is broken in Prisma 7
Severity
Reproduction
Expected vs. Actual Behavior
Querying for the same data with the same filters directly or in a nested selection yields different results (nested result returns an empty set)
Frequency
Consistently reproducible
Does this occur in development or production?
Both development and production
Is this a regression?
This definitely worked in the rust engine, but I am not sure if this ever worked correctly with adapters
Workaround
Querying data without bested selections works, but for Pothos this would be massively inefficient and require a lot of refactoring
Prisma Schema & Queries
model Post {
id Int @id @default(autoincrement())
bigIntId BigInt @unique
createdAt DateTime @unique @default(now())
updatedAt DateTime @updatedAt
title String
content String?
author User @relation(fields: [authorId], references: [id])
authorId Int
}
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
posts Post[]
}const prisma = new PrismaClient({
adapter: new PrismaBetterSqlite3({ url: 'file:./dev.db' })
});
// ✓ WORKS
await prisma.post.findMany({
where: { authorId: 1 },
take: 2,
skip: 1,
cursor: { id: 245 },
orderBy: { createdAt: 'desc' }
});
// ✗ FAILS (returns 0 posts instead of 2)
await prisma.user.findUnique({
where: { id: 1 },
include: {
posts: {
take: 2,
skip: 1,
cursor: { id: 245 },
orderBy: { createdAt: 'desc' }
}
}
});Prisma Config
// Add your `prisma.config.ts`Logs & Debug Info
// Debug logs here
Environment & Setup
- OS:
- Database:
- Node.js version:
Prisma Version
7.0.0
Reacted by Drew Johnson and Dom Webber
Metadata
Metadata
Assignees
Labels
kind/bugA reported bug.
Activity
hayes commentedon Nov 21, 2025
I am on vacation without a computer, but have been pinged several times about Prisma 7 and Pothos issues. I've done my best to create a clear reproduction via llms I can use from my phone. Apologies for not having a more complete report, but hopefully this is clear enough to show the issue
hayes commentedon Dec 3, 2025
had some time to actually dig into this a bit more. I think the root cause here is related to the new adapters default DateTime representation being different than what was used in prisma 6. Explicitly setting the format in the adapter resolves the issue
TrevHeath commentedon Feb 17, 2026
@hayes I am running into this issue, can you expand on your fix here?
hayes commentedon Feb 17, 2026
https://github.com/hayes/pothos/blob/d52c66376c13edc59b8c8f643aac1b0345499313/packages/plugin-prisma/tests/example/builder.ts#L13
arasrezaei commentedon Feb 19, 2026
still broken (v7.4.1)