Prisma DMMF parses comments as fields docs
See original GitHub issueBug description
I’m using latest alpha.980 and I’ve discovered that it now parses the comments // as docs for the fields:
{
"name": "author",
"kind": "object",
"dbNames": [],
"isList": false,
"isRequired": true,
"isUnique": false,
"isId": false,
"type": "User",
"relationName": "PostToUser",
"relationToFields": [
"id"
],
"relationOnDelete": "NONE",
"isGenerated": false,
"isUpdatedAt": false,
"documentation": "coAuthor User?\r"
},
Even worse, it also parse whole comments of model/enum field as base level docs:
{
"name": "Role",
"values": [
{
"name": "USER",
"dbName": null
},
{
"name": "ADMIN",
"dbName": null
}
],
"dbName": null,
"documentation": "/ Role enum comment\r\nUSER = \"User\"\r\nADMIN = \"Admin\"\r"
}
Expected behavior
It should parse the docs and comments just like in preview024.
Prisma information
model Post {
uuid String @default(uuid()) @id
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
published Boolean
title String
content String?
// coAuthor User?
author User
kind PostKind?
}
/// Role enum comment
enum Role {
// USER = "User"
USER
// ADMIN = "Admin"
ADMIN
}
Environment & setup
- OS: [e.g. Mac OS, Windows, Debian, CentOS, …] Win 10 x64
- Database: [PostgreSQL, MySQL, MariaDB or SQLite] —
- Prisma version: [Run
prisma2 -vto see your Prisma version] alpha 980 - Node.js version: [Run
node -vto see your Node.js version] 13.11
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Working with fields (Concepts) - Prisma
This section describes how to perform CRUD operations on more advanced field types. Working with Decimal. Decimal fields are represented by the Decimal.js ......
Read more >Trouble using "Integer" type in Prisma ORM schema for ...
It looks like the type you should use is called Int . I'm getting that from this Prisma documentation listing the different field...
Read more >prisma-generator-nestjs - npm package - Snyk
Generates DTO and Entity classes from Prisma Schema for NestJS with class-validator support For more information about how to use this package see...
Read more >Prisma 4.3.0 Release - GitClear
Learn more about field references in our documentation. Try it out and let us know what you think in this GitHub issue. Count...
Read more >Create Prisma Generator - DEV Community 👩💻👨💻
Tagged with typescript, javascript, prisma, generator. ... which takes the parsed Prisma schema as an input and has full freedom to output ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

The issue with enums is fixed now.
Yes, it causes a blocking problem as the TypeGraphQL integration uses the
documentationproperty to emit GraphQL description as well as JSDoc description.