Hello everyone, I need a quick solution for a prob...
# orm-help
c
Hello everyone, I need a quick solution for a problem I’ve encountered lately… so I’m using prisma on my Apollo Server app to perform read/write operations on the database. The problem is that I want to encrypt my data before saving it and decrypt it when an authenticated user requests it… any way to do this besides doing it manually in the resolver functions?
1
m
You might want to take a look at Prisma Middleware: https://www.prisma.io/docs/concepts/components/prisma-client/middleware
💯 1
c
this sure looks promising! thank you sir!
n
Thanks for chiming in again Martïn 😄 @Calin Zapan, let me know if that solves your problem or if you have further questions 🙂
c
Hello @nikolasburk, I’ve ended up encrypting only the sensitive data in the resolvers and decrypting it in the middleware… works flawlessly
💯 2
didn’t know about the middleware, ’cause I was using Prisma 2.0.1… was about time to update to the stable version
n
Awesome! 😄