Prisma Nested Middleware
JSON →Prisma Nested Middleware is a utility library designed to extend Prisma's native middleware capabilities, specifically for handling nested write operations and relations within queries. While standard Prisma middleware (version 4.0.0 is the latest as of January 2024, with a consistent release cadence) is effective for top-level queries, it lacks the ability to intercept and modify operations on nested relations. This library addresses that limitation by providing a `createNestedMiddleware` function that wraps your middleware, allowing it to be called for every nested relation in a Prisma query. It exposes an enhanced `NestedParams` object, which includes critical context like `scope`, `modifier`, `logicalOperators`, and `relations` that are unavailable in standard Prisma middleware, enabling fine-grained control over complex data manipulations.
Traffic · last 30 days ↓83% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇷 France · 🇳🇴 Norway · 🇩🇪 Germany