New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Triple-slash Comments should attach to Composite Types #13726
Comments
I'm also generating DTOs from the prisma schema and decorating the properties with class-validators etc. With the Now, I'm extending my generator for composite types |
Thanks for that information bit, seems my colleague missed the details that this works different for |
Hello @janpio, any updates on this bug? |
No, there is no confirmed reproduction and the issue only gets minimal upvotes/👍 so this is low in our priority list. We'll get to it some time, but not sure when. |
@janpio We encounter the same issue, DMMF does not expose documentation for composite types. We plan to use prisma + generators for GraphQL types and this is kind of blocking because of missing documentation in the resulting schema. Is there any progress on the Ticket? |
@michaelpoellath A project that makes it easy to confirm that these values are missing would help as a first step. Maybe something that outputs the dmmf, and shows how some comments are attached and some are not. When we have the confirmation, we can either prioritize this or help you figure out where things might be going wrong. (This is certainly in our Rust codebase at |
Sorry for the late update @janpio! I just created a demo repo (https://github.com/michaelpoellath/prisma-13726) which shows that docs on |
Thank you! To persist:
leads to:
because of this DMMF datamodel for the generator (
|
Related issue: #17828 (but for enums) |
Found the issue and preparing a fix. Will update here with a link later. |
Bug description
Currently, triple-slash comments ("///") only appear to attach to actual model types.
They should also attached to composite types.
How to reproduce
Example:L
(note, I am trying to use the nestjs-prisma-graphql package to apply validators, which is dependent on the comments functionality and so also fails to generate the validator decorators in the TS input types. But at the most basic - not involving any other packages, the basic comment I applied to the 'name' doesn't come over)
Expected behavior
Expect the comments on composite types to be included in the generated TS types.
Example of it working on a regular model entry:
(here you can see the nestjs-prisma-graphql package is able to pick up the decorators in the comments and apply them)
Prisma information
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: