With prisma.io (graphQl), we have:
datamodel.graphql
"""I am a great User"""
type User {
id: ID! @unique
email: String! @unique
}
after doing prisma deploy
, it generates a file without the comment from the file datamodel.graphql
generated-schema.graphql
type User implements Node {
id: ID!
email: String!
}
How can we add a comment for a Type in order to generate a documentation in playground?
Workaround:
If I cheat and add a comment in the generated-schema.graphql
(this file will be overridden after the next prisma deploy
)
"""I am a great User"""
type User implements Node {
id: ID!
email: String!
}
Related topics:
The answer is here: https://www.prisma.io/forum/t/comments-in-prisma-graphql-from-datamodel-graphql/4330/2?u=alan345
Currently, there’s no easy way to resolve this. This is an open feature request, which you can learn more about here:
https://github.com/prisma/prisma/issues/2152