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

Unsupported Prisma Fields Break Input Generation #203

Open
Jrodseth opened this issue Dec 12, 2023 · 1 comment
Open

Unsupported Prisma Fields Break Input Generation #203

Jrodseth opened this issue Dec 12, 2023 · 1 comment

Comments

@Jrodseth
Copy link

Given a Prisma definition with an 'Unsupported' field, like this

model Feature {
  /// @Validator.IsUUID()
  /// @HideField({ match: 'Feature@(Create|Update)*Input' })
  id                 String                   @id @unique @default(dbgenerated("gen_random_uuid()")) @db.Uuid
  geometry           Unsupported("geometry(Polygon, 4326)") @map("geometry")
  /// @Validator.IsString()
  name           String 
}

All of the create and update input files will not be generated.

If the Unsupported field is commented out, the create and update files are created.

I would expect adding the HideField annotation to fix the problem:

model Feature {
  /// @Validator.IsUUID()
  /// @HideField({ match: 'Feature@(Create|Update)*Input' })
  id                 String                   @id @unique @default(dbgenerated("gen_random_uuid()")) @db.Uuid
  /// @HideField({ input: true, output: true })
  geometry           Unsupported("geometry(Polygon, 4326)") @map("geometry")
  /// @Validator.IsString()
  name           String 
}

However, the create and update input types are still not generated.

It would be great to either ignore Unsupported fields by default during generation or respect the @HideField annotation for them.

@pepusz
Copy link

pepusz commented May 12, 2024

Any update on this?

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

No branches or pull requests

2 participants