prisma-nestjs-graphql
prisma-nestjs-graphql copied to clipboard
Description on type in schema.prisma not added to GraphQL
First of, love the project, great work here, helps us a lot!
We have multiple models and types in our schema.prisma file with many comments. When generating GraphQL classes we are missing all doc strings on the types.
Sample schema.prisma:
## Descriptions lost
/// NameValueUnit explains itself
type NameValueUnit {
/// Name is foo
name String?
/// Value is bar
value Float?
/// Unit is baz
unit String?
}
## Works as expected, descriptions are on GraphQL Classes
/// testing
model Test {
/// NameValueUnit
nvu NameValueUnit
}
Am I doing something wrong? Is it possible to add these or is this an upstream issue with Prisma?
Edit
Found a related Ticket on Prisma https://github.com/prisma/prisma/issues/13726 . Seems like an upstream issue.
Indeed. Generated Data Model Meta Format (DMMF) does not contain information about comments for type blocks.
There is a 3rd party schema parser - https://github.com/MrLeebo/prisma-ast But it doesnt see composite types.
I fixed the issue in https://github.com/prisma/prisma/issues/13726 and it should be released with 4.16.0.
@unlight hey there 👋
I'm the author of prisma-ast. I wanted to drop in and mention that prisma-ast now supports composite types as of v0.9.0. If you notice any other prisma objects that are missing, don't hesitate to leave me a note. I may not know about them otherwise.