prisma use middleware
Hi I am trying to collect logs for args before query request.
However, in case of USE (middleware), it is checked as deprecated, is it possible that the feature will be removed in future updates?
If so, I was wondering where I can collect ARGS logs for all query requests as an alternative to the middleware.
2 Replies
We have no plans to remove middleware at this time. It's safe to use 🙂
Hi @IH 👋
We recommend using Prisma Client Extension as an alternative to middleware. Prisma Client Extension provide a more flexible and type-safe way to extend the functionality of the Prisma Client.
To collect logs for arguments before a query request using Prisma Client Extension, you can use the query component type.
See this section of the documentation.
Prisma Client extensions: query component | Prisma Documentation
Extend the functionality of Prisma Client, query component