You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enum fields of included relations are returned as @map values instead of enum names #2926
Enum fields of relations loaded with include (or a nested select) are returned in their database representation (the @map value) instead of the enum member name. Top-level fields are mapped correctly.
Reproduction
enum S {
DRAFT @map('draft')
ACTIVE @map('active')
}
model User {
id Int @id
status S
posts Post[]
}
model Post {
id Int @id
status S
authorId Int
author User @relation(fields: [authorId], references: [id])
}
Reproduces on both SQLite and PostgreSQL (dev, 3.10.1).
Cause
QueryNameMapper maps enum values back to names only for plain column selections (processEnumSelection). Nested relations are built as JSON inside a subquery, e.g. on PostgreSQL:
Activity