P
Prisma•2w ago
K1|ller

how do you manage very large models in nextjs?

So I made an app in nextjs and the user model is HUGE, around 70 lines of fields + relations, orders, products, chats, messages, reviews as buyer, as seller, followers, notifications and many fields. The app isn't slow but I don't want the app to carry this information in everyplace because not all fields are necessary all the time and also I want to hide some information. How do you manage large objects in your nextjs app with prisma?
2 Replies
Prisma AI Help
Prisma AI Help•2w ago
You chose to debug with a human. They'll tinker with your query soon. If you get curious meanwhile, hop into #ask-ai for a quick spin!
Nurul
Nurul•2w ago
Hey @K1|ller 👋 You could globally or on per query basis configure database fields that you wish to omit in database response. https://www.prisma.io/docs/orm/prisma-client/queries/excluding-fields Would something like this be helpful to you?
Excluding fields | Prisma Documentation
This page explains how to exclude sensitive fields from Prisma Client

Did you find this page helpful?