Skip to content

Type error when using Prisma v7 with prisma-nestjs-graphql and enum @map #249

@hiroingk

Description

@hiroingk

When using Prisma v7 in combination with prisma-nestjs-graphql, TypeScript type errors occur whenever an enum uses the @map attribute.

It appears that the issue is caused by the recently introduced feature:

“ We now support the @map attribute for enum members, which can be used to set their expected runtime values.”
https://github.com/prisma/prisma/releases/tag/7.0.0

Related issue
prisma/prisma#8446

prisma-nestjs-graphql seems to generate GraphQL types based on the enum names rather than the mapped runtime values, which leads to type mismatches and compile-time errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions