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

Multi-line comments in schema.prisma generate invalid types #132

Closed
P4sca1 opened this issue Aug 28, 2021 · 1 comment · Fixed by #134
Closed

Multi-line comments in schema.prisma generate invalid types #132

P4sca1 opened this issue Aug 28, 2021 · 1 comment · Fixed by #134
Assignees
Labels
generator Related to the Prisma generator part of Nexus Prisma type/bug Something is not working the way it should

Comments

@P4sca1
Copy link

P4sca1 commented Aug 28, 2021

  1. Write a multiline comment above a model in your schema.prisma file, e.g.:
/// A TOTPAuthenticator represents an authenticator that a User has set up,
/// which can solve [TOTP](https://de.wikipedia.org/wiki/Time-based_One-time_Password_Algorithmus) challenges.
model TotpAuthenticator {
    id           Int      @id @default(autoincrement())
    /// The encrypted secret of the authenticator.
    secret       String
    /// Whether the authenticator has been verified. A User must enter a correct TOTP code one time, to verify the authenticator.
    verified     Boolean  @default(false)
    registeredAt DateTime @default(now())
    userId       Int      @unique
    user         User     @relation(fields: [userId], references: [id], onUpdate: Cascade, onDelete: Cascade)

    @@map("totp_authenticator")
}

  1. Run prisma generate

The TypeScript declaration file nexus generates will become invalid, e.g.:

export interface TotpAuthenticator {
  $name: 'TotpAuthenticator'
  $description: 'A TOTPAuthenticator represents an authenticator that a User has set up,
which can solve [TOTP](https://de.wikipedia.org/wiki/Time-based_One-time_Password_Algorithmus) challenges.'

Note the line break in the single-quoted string.

@P4sca1 P4sca1 added the type/bug Something is not working the way it should label Aug 28, 2021
@jasonkuhrt jasonkuhrt added the generator Related to the Prisma generator part of Nexus Prisma label Aug 30, 2021
@jasonkuhrt jasonkuhrt self-assigned this Aug 30, 2021
@jasonkuhrt jasonkuhrt pinned this issue Aug 30, 2021
jasonkuhrt added a commit that referenced this issue Aug 30, 2021
@jasonkuhrt jasonkuhrt unpinned this issue Aug 30, 2021
@rostislav-simonik-nexus-prisma-admin
Copy link
Collaborator

🎉 This issue has been resolved in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
generator Related to the Prisma generator part of Nexus Prisma type/bug Something is not working the way it should
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants