Skip to content

Nested default includes lose scalar result inference in rc.8 #30207

Description

@JoeRoddy

Type: type inference bug. Target: prisma/orm SQL ORM client.

Run npm run typecheck in the standalone reproduction. include-types.ts compares these native queries over its generated contract:

native.orm.public.Post.include("comments", c => c.include("author")).first();
native.orm.public.Post.include("comments", c =>
  c.select("id").include("author", a => a.select("id"))
).first();

The first query's comment id is inferred as unknown; assigning it to string | undefined fails. Explicitly selecting the same nested scalar preserves string | undefined. Both paths should retain the generated schema's field types, including when selection is implicit. The reproduction's @ts-expect-error records the native defect and should become unused when fixed. No type cast or authorization-adapter import is involved.

Relevant regression coverage includes default and explicit root/nested selections, optional and required to-one includes, multiple to-many nesting levels, scalar codecs, nullable fields, and include reducers. This report is limited to default-selection inference loss.

Primary source: ORM types, collection.

Environment

  • @prisma/orm-postgres: 8.0.0-rc.8 (the live latest tag when reverified September 6, 2026)
  • Prisma CLI: 8.0.0-rc.13
  • TypeScript: 5.9.3
  • Node: 26.5.0
  • npm: 11.17.0
  • OS: macOS 26.6.2 arm64
  • PostgreSQL: 14.23 for database-backed cases

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions