prisma / prisma-client-js

Type-safe database client for TypeScript & Node.js (ORM replacement)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: Generate `model` names for `MiddlewareParams`

joeyaurel opened this issue · comments

Problem

The client generator generates a MiddlewareParams type whose keys are model, action, ... and so forth. action is from type PrismaAction and consists of several action types. model on the other hand is just a string and one must always know the exact names of models available in the schema.

Suggested solution

Generate a PrismaModel type (or similar) consisting of the names of models available as strings and attach it to the model property of MiddlewareParams.

Alternatives

Leave it as it is.

I think this is a duplicate of prisma/prisma#3545

This actually being worked on so I expect it to land.