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
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!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