prisma-generator-pothos-codegen icon indicating copy to clipboard operation
prisma-generator-pothos-codegen copied to clipboard

Omit an unused input types from input.ts

Open 6br opened this issue 1 year ago • 1 comments

Feature request: Is it possible to omit unused input types from inputs.ts ,e.g., by using model description?

Example:

/// @Pothos.omit(create, update)
model User {
  id        String   @id @default(uuid())
  email     String
  password  String
}

Background: I'd like to disable create/update for some models. When I exclude a model from generateAllMutations like generateAllMutations({ exclude: ["User"] }) , unused input types (e.g. UserCreateInput) remain on inputs.ts, which are displayed on GraphQL schema.

6br avatar Jun 07 '23 01:06 6br

Great idea, thanks for the suggestion I'll work on this at some point when I'm freer Contributions are welcome, the code for this project is very lean e.e

Cauen avatar Jun 23 '23 19:06 Cauen