{"id":48685,"library":"nestjs-prisma-graphql-crud-gen","title":"NestJS Prisma GraphQL CRUD Generator","description":"Generate full CRUD resolvers, services, modules, inputs, outputs, and enums from your Prisma schema for NestJS/GraphQL applications. v2.1.0 — active development, release cadence is irregular. Key differentiator: automates the entire boilerplate of Nexus-style or code-first GraphQL CRUD, not just type generation. Unlike typegraphql-prisma or @nestjs/graphql codegen plugins, this outputs ready-to-use NestJS module files (resolvers, services, DTOs) that integrate with your existing app.","status":"active","version":"2.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/mk668a/nestjs-prisma-graphql-crud-gen","tags":["javascript","prisma","prisma2","graphql","generator","typescript"],"install":[{"cmd":"npm install nestjs-prisma-graphql-crud-gen","lang":"bash","label":"npm"},{"cmd":"yarn add nestjs-prisma-graphql-crud-gen","lang":"bash","label":"yarn"},{"cmd":"pnpm add nestjs-prisma-graphql-crud-gen","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Runtime dependency for Prisma client used in generated services.","package":"@prisma/client","optional":false},{"reason":"NestJS decorators and base classes for generated modules.","package":"@nestjs/common","optional":false},{"reason":"GraphQL decorators (ObjectType, ArgsType, etc.) used in generated code.","package":"@nestjs/graphql","optional":false},{"reason":"GraphQL types and utilities used in generated output.","package":"graphql","optional":false},{"reason":"Required to run the generator via prisma generate.","package":"prisma","optional":true}],"imports":[{"note":"PrismaService is a custom NestJS service wrapping @prisma/client. It is not exported by this package; you must create it yourself or use a separate library like nestjs-prisma.","wrong":"import { PrismaService } from '@prisma/client'","symbol":"PrismaService","correct":"import { PrismaService } from './prisma/prisma.service'"},{"note":"Since Apollo Server 4, the recommended import is from 'graphql'. The 'apollo-server-errors' package is deprecated.","wrong":"import { GraphQLError } from 'apollo-server-errors'","symbol":"GraphQLError","correct":"import { GraphQLError } from 'graphql'"},{"note":"NestJS GraphQL resolvers use the @Resolver decorator from @nestjs/graphql, not the one from @nestjs/common which is for REST controllers.","wrong":"import { Resolver } from '@nestjs/common'","symbol":"Resolver","correct":"import { Resolver } from '@nestjs/graphql'"}],"quickstart":{"code":"// 1. Add generator to schema.prisma:\n// generator custom_generator {\n//   provider = \"nestjs-prisma-graphql-crud-gen\"\n//   output   = \"../generated\"\n// }\n\n// 2. Install and run:\n// yarn add nestjs-prisma-graphql-crud-gen\n// npx prisma generate\n\n// 3. Example usage in NestJS app:\nimport { Module } from '@nestjs/common';\nimport { GraphQLModule } from '@nestjs/graphql';\nimport { ApolloDriver, ApolloDriverConfig } from '@nestjs/apollo';\nimport { PrismaService } from './prisma/prisma.service';\nimport { UsersModule } from './generated/users/users.module';\n\n@Module({\n  imports: [\n    GraphQLModule.forRoot<ApolloDriverConfig>({\n      driver: ApolloDriver,\n      autoSchemaFile: true,\n    }),\n    UsersModule,\n  ],\n  providers: [PrismaService],\n})\nexport class AppModule {}","lang":"typescript","description":"Shows how to integrate the generated CRUD module into a NestJS app with GraphQL and Prisma."},"warnings":[{"fix":"Manually add related types and resolvers for relations in the generated files or extend them in your own code.","message":"Generator output may not include all GraphQL relations (e.g., @relation fields) automatically.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use graphql@16 or later in your project.","message":"The generator uses 'graphql' v16 internally; ensure your app is compatible with v16+.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Extend or override generated modules using NestJS module augmentation or write a custom wrapper module that extends the generated one.","message":"Generated files are overwritten on every prisma generate. Do not edit them directly.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Update import paths to match the new structure (e.g., './generated/users/users.module' instead of './generated/users.module').","message":"v2.0.0 changed the output directory structure; previously generated files were flat, now grouped by model.","severity":"breaking","affected_versions":">=2.0.0"}],"env_vars":null,"search_vec":"'activ':24 'app':75 'applic':22 'autom':32 'boilerpl':35 'cadenc':27 'code':42 'code-first':41 'codegen':56 'crud':4,8,45 'develop':25 'differenti':31 'dtos':69 'entir':34 'enum':15 'exist':74 'file':66 'first':43 'full':7 'generat':5,6,49,80 'graphql':3,44,79 'input':12 'integr':71 'irregular':29 'javascript':76 'key':30 'modul':11,65 'nestj':1,64 'nestjs/graphql':21,55 'nexus':38 'nexus-styl':37 'output':13,59 'plugin':57 'prisma':2,18,53,77 'prisma2':78 'readi':61 'ready-to-us':60 'releas':26 'resolv':9,67 'schema':19 'servic':10,68 'style':39 'type':48 'typegraphql':52 'typegraphql-prisma':51 'typescript':81 'unlik':50 'use':63 'v2.1.0':23","created_at":"2026-06-07T16:57:55.215625+00:00","updated_at":"2026-06-07T16:57:55.215625+00:00","problems":[{"fix":"yarn add nestjs-prisma-graphql-crud-gen --dev and ensure tsconfig.json includes 'node_modules' in types.","cause":"Package not installed or TypeScript cannot resolve types (missing @types).","error":"Cannot find module 'nestjs-prisma-graphql-crud-gen' or its corresponding type declarations."},{"fix":"Add a custom scalar mapping in your GraphQL module or use the built-in DateType from @nestjs/graphql.","cause":"Prisma schema uses DateTime field but GraphQL scalar mapping is missing.","error":"Error: Cannot determine GraphQL type for 'DateTime'"},{"fix":"Upgrade @nestjs/graphql to v10+ and ensure @nestjs/common is v10+.","cause":"Mismatched versions of @nestjs/common and @nestjs/graphql (likely NestJS 10+ with older graphql peer).","error":"TypeError: (0 , module_1.createParamDecorator) is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/mk668a/nestjs-prisma-graphql-crud-gen","github":"https://github.com/mk668a/nestjs-prisma-graphql-crud-gen","docs":null,"changelog":null,"pypi":null,"npm":"nestjs-prisma-graphql-crud-gen","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}