npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

prisma-generator-typegraphql

v1.0.5

Published

![integration logo](https://raw.githubusercontent.com/MichalLytek/typegraphql-prisma/main/img/integration.png)

Readme

integration logo

TypeGraphQL & Prisma integration

🌐 Read in other languages: Português | Español

Prisma generator to emit TypeGraphQL types and CRUD resolvers from your Prisma schema. This project is a copy of typegraphql-prisma, and I intend to keep it updated, implementing new features as Prisma is updated.

✅ Prisma 7 Support

This library now fully supports Prisma 7, including all breaking changes and new features. All tests are passing and the generator is production-ready.

⚠️ MongoDB Notice: Prisma 7 does not yet support MongoDB. If you are using MongoDB, please use version 0.1.0 of this library with Prisma 6.19 until MongoDB support is added to Prisma 7.

🔧 Changelog

v1.0.4

Fixed: circular import errors with bundlers like Turbopack.

Previous versions generated import statements between input type files that could form dependency cycles. Strict bundlers such as Next.js Turbopack would throw a ReferenceError: Cannot access 'X' before initialization at runtime because a class was referenced before its module finished loading.

Version 1.0.4 solves this by:

  • Generating import type (type-only imports) for cross-input-type references — these are erased at runtime and do not create module-load dependencies.
  • Using a lazy require() call inside each @Field type thunk so the class is only accessed after all modules are fully initialized.

No changes to your Prisma schema or application code are needed — just regenerate with prisma generate.


Version compatibility:

| Library Version | Prisma Version | MongoDB Support | | --------------- | -------------------- | --------------- | | 1.0.x | Prisma 7.x | ❌ Not yet | | 0.1.0 | Prisma 5.18.0+ / 6.x | ✅ Yes |

⚠️ Important: If you are using Prisma 5 or 6, install version 0.1.0. Version 1.0.x is only compatible with Prisma 7.

Prisma 7 migration notes

Driver adapters are now required. Prisma 7 removed the built-in query engine, so every PrismaClient must receive a driver adapter. Install the adapter for your database, for example:

npm install @prisma/adapter-pg pg

Then pass it when constructing the client:

import { PrismaClient } from "./prisma/generated/client/client";
import { Pool } from "pg";
import { PrismaPg } from "@prisma/adapter-pg";

const pool = new Pool({ connectionString: process.env.DATABASE_URL });
const adapter = new PrismaPg(pool);
const prisma = new PrismaClient({ adapter });

Generated import path changed. In Prisma 7 the entry point of the generated client is client.ts instead of index.ts. The generator handles this automatically, but if you set customPrismaImportPath in your schema you must append /client:

generator typegraphql {
  provider               = "typegraphql-prisma"
  // Prisma 7: point to client.ts, not just the folder
  customPrismaImportPath = "../generated/client/client"
}

Environment variables are not auto-loaded. Prisma 7 no longer reads .env automatically. Add import "dotenv/config" at the top of any file that uses PrismaClient or call dotenv.config() before instantiating it.

Align prisma CLI and @prisma/client versions. Always keep both packages on exactly the same version to avoid runtime errors at startup.

Feel free to send PRs with improvements and new features. Let's keep this lib together!

https://prisma.typegraphql.com

Documentation

The documentation, installation guide, detailed description of the API and all of its features is available on the original website. In the future, I will be implementing a dedicated website for this lib's documentation.

Examples

⚠️ Note: The examples have not yet been migrated to Prisma 7. They still use the previous version of the library. Migration is in progress.

You can check out some usage examples on this repo:

https://github.com/lucasrivoiro/prisma-generator-typegraphql/tree/main/examples/Readme.md

Experiments

The experiments folder contains ready-to-run projects for testing the generator with different databases. These are useful for development and testing purposes.

PostgreSQL Experiment

A complete setup with PostgreSQL database using Docker.

Setup:

cd experiments/postgres

# Install dependencies
npm install

# Start PostgreSQL container
docker compose up -d

# Run migrations
npx prisma migrate deploy

# Seed the database
npx prisma db seed

# Start the GraphQL server
npm run start

The server will be available at http://localhost:4000/graphql

Requirements:

  • Docker and Docker Compose
  • Node.js 20.19.0+

MongoDB Experiment

⚠️ Note: MongoDB is not yet supported in Prisma 7. This experiment requires Prisma 6.19 or earlier.

A setup for MongoDB database using Docker.

Setup:

cd experiments/mongodb

# Install dependencies
npm install

# Start MongoDB container
docker compose up -d

# Push schema to database
npx prisma db push

# Seed the database
npx prisma db seed

# Start the GraphQL server
npm run start

The server will be available at http://localhost:4000/graphql

Requirements:

  • Docker and Docker Compose
  • Node.js 20.19.0+
  • Prisma 6.19 (MongoDB not supported in Prisma 7 yet)