Cauen / prisma-generator-pothos-codegen

The fastest way to create a fully customizable CRUD Graphql API from Prisma Schema.
https://www.npmjs.com/package/prisma-generator-pothos-codegen
95 stars 16 forks source link

Omit an unused input types from input.ts #46

Open 6br opened 1 year ago

6br commented 1 year ago

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.

Cauen commented 1 year ago

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