Middleware Context

Allow passing of context to middleware.

Project Toolchain Usage

This feature makes use of these Project Toolchain APIs: Middleware, Extensions. Because of this usage, it defines the following modules:

middlewareContext

This module defines the following middleware and extensions identifiers that can be imported via Project Toolchain, along with their descriptions:

  • contextRemover - Prevent the context from reaching Prisma.

To enable this optional feature, add the contextRemover element to your optionalFeatures array, then use the generated middleware or extension inside of your code.

If you are using the middleware, make sure that it's the last one in the chain.

Feature Effect

This feature modifies the generated Prisma Client to include this parameter to all operations:

index.d.ts
context?: {[key: string]: any}

Last updated