@itez-io/nexus-plugin-prisma
v7.5.0
Published
| Dependency | Version | |---|---| | `@prisma/client` | `^7.5.0` | | `nexus` | `1.3.0` | | `graphql` | `^16.6.0` |
Readme
This plugin integrates Prisma into Nexus. It gives you an API to project fields from models defined in your Prisma schema into your GraphQL API. It also gives you an API to build GraphQL root fields that allow your API clients to query and mutate data.
You can find the documentation on the Nexus website.
Supported versions
| Dependency | Version |
|---|---|
| @prisma/client | ^7.5.0 |
| nexus | 1.3.0 |
| graphql | ^16.6.0 |
Breaking changes from previous versions
Naming strategy: pluralize → xxxList
The default naming for findMany CRUD operations has changed.
| Before (pluralize) | After (List suffix) |
|---|---|
| t.crud.users() | t.crud.userList() |
| t.crud.blogPosts() | t.crud.blogPostList() |
The pluralize dependency has been removed. Model names now use a List suffix instead. This eliminates unpredictable naming caused by irregular plurals (e.g. person→people).
Prisma 7 migration
Runtime path change
Prisma 7 changed the internal runtime path.
// Prisma 5.x
@prisma/client/runtime/library
// Prisma 7.x
@prisma/client/runtime/clientThe plugin handles this internally with automatic fallback, so no action is required on the user side.
DMMF internalization
All external DMMF dependencies have been removed:
@prisma/client/runtimetype imports removed — DMMF types are now defined internally viasrc/dmmf/PrismaDMMF.tsnamespace.@prisma/client/generator-builddependency removed —externalToInternalDmmf()andgetMappings()are now implemented within the plugin.
This makes the plugin resilient to Prisma internal API changes across version upgrades.
New options: schemaPath and dmmfDocument
To reduce coupling with @prisma/client internals, two new options have been added for explicit DMMF source specification:
// Option 1: Specify schema.prisma path directly (recommended)
nexusPrisma({
schemaPath: resolve("prisma/schema.prisma"),
experimentalCRUD: true,
})
// Option 2: Inject DMMF data directly
import dmmf from "./generated/dmmf.json"
nexusPrisma({
dmmfDocument: dmmf,
experimentalCRUD: true,
})
// Option 3: Legacy (no options) — auto-detection fallback
nexusPrisma({
experimentalCRUD: true,
})| Option | Behavior |
|---|---|
| schemaPath | Reads schema.prisma directly, skips auto-detection of .prisma/client/ path |
| dmmfDocument | Skips DMMF acquisition entirely, uses provided data as-is |
| Neither | Falls back to legacy auto-detection logic (compatible with previous versions) |
Using schemaPath is recommended as it avoids fragile path detection and works reliably across Prisma versions.
Installation
npm install @itez-io/nexus-plugin-prisma
# OR
yarn add @itez-io/nexus-plugin-prismaUsage notes
AWS Lambda packaging
Make sure to include @prisma/internals in your AWS Lambda packaged node_modules folder, in addition to the @prisma/client package.
To mitigate overall package size issues, remove all libquery_engine-debian-openssl-1.1.x.so.node files under node_modules/@prisma as they are not leveraged by AWS Lambda.
Package management
Build, test
build
yarn
yarn buildtest
yarn test
If tests need snapshot updates, run yarn test:run:rebaseSnapshots
Dependencies versioning
update all packages
yarn update:all