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

Unknown scalar type "Null" for ... . #50

Closed
tkow opened this issue Nov 28, 2022 · 1 comment · Fixed by #51
Closed

Unknown scalar type "Null" for ... . #50

tkow opened this issue Nov 28, 2022 · 1 comment · Fixed by #51
Labels
bug Something isn't working

Comments

@tkow
Copy link

tkow commented Nov 28, 2022

Describe the bug
If defining nullable column in schema.prisma, fabbrica generator fails to transpile.

To Reproduce

Rewrite example-prj's schema.prisma in this repository as like followed by example.

generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["interactiveTransactions"]
}

generator fabbrica {
  provider = "prisma-fabbrica"
}

datasource db {
  provider = "sqlite"
  url      = env("DATABASE_URL")
}

model User {
  id    String @id
  name  String?
  posts Post[]
}

model Post {
  id       String @id
  title    String
  author   User   @relation(fields: [authorId], references: [id])
  authorId String
}

and npx prisma migrate dev

Expected behavior

Generate fabbrica codes.

Your Schema

generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["interactiveTransactions"]
}

generator fabbrica {
  provider = "prisma-fabbrica"
}

datasource db {
  provider = "sqlite"
  url      = env("DATABASE_URL")
}

model User {
  id    String @id
  name  String?
  posts Post[]
}

model Post {
  id       String @id
  title    String
  author   User   @relation(fields: [authorId], references: [id])
  authorId String
}

Environment (please complete the following information):

  • Database kind [PostgreSQL, sqlite]
  • Node.js version [v16.15.0]
  • @prisma/client version [4.6.1]
  • TypeScript version [e.g. 4.9.3]

Additional context

@tkow tkow changed the title Unknown scalar type "Null" for User.name . Unknown scalar type "Null" for ... . Nov 28, 2022
@Quramy Quramy added the bug Something isn't working label Nov 28, 2022
@Quramy
Copy link
Owner

Quramy commented Nov 28, 2022

Oops, I'm sorry. I'll fix this and thanks for your reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants