Skip to content
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

Description on type in schema.prisma not added to GraphQL #157

Open
michaelpoellath opened this issue Jan 26, 2023 · 4 comments
Open

Description on type in schema.prisma not added to GraphQL #157

michaelpoellath opened this issue Jan 26, 2023 · 4 comments
Assignees
Labels

Comments

@michaelpoellath
Copy link

michaelpoellath commented Jan 26, 2023

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 prisma/prisma#13726 . Seems like an upstream issue.

@unlight
Copy link
Owner

unlight commented Jan 26, 2023

Indeed. Generated Data Model Meta Format (DMMF) does not contain information about comments for type blocks.

@unlight unlight self-assigned this Jan 26, 2023
@unlight
Copy link
Owner

unlight commented Jan 26, 2023

There is a 3rd party schema parser - https://github.com/MrLeebo/prisma-ast
But it doesnt see composite types.

@unlight unlight added the prisma label Jan 26, 2023
@michaelpoellath
Copy link
Author

I fixed the issue in prisma/prisma#13726 and it should be released with 4.16.0.

@MrLeebo
Copy link

MrLeebo commented Feb 1, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants