NestJS · Senior · Question 75 of 75
Why may a global ClassSerializerInterceptor not hide fields when you return results from Prisma?
- 1Prisma encrypts fields
- 2The interceptor works only with GraphQL
- ✓Correct answer: Prisma returns plain objects, not class instances, so
class-transformerdecorators don't apply; map to response classes or select fields explicitly
Explanation
With Prisma, select or omit in the query is the most reliable way to never fetch sensitive fields.