I have a User model, and in my schema.graphql I ...
# orm-help
k
I have a User model, and in my schema.graphql I want to add computed field. If I first query user from prisma server, and then add the computed field to user object. Then the computed filed is computed even if frontend user does not include this filed in the query. I know in normal Graphql server, resolver for a field is not executed unless the filed is requested in the query. What if I have several computed filed, do I have to computed all of them in my resolver even if they are not requested? What if the computed filed depend on field that are not requested by frontend user, do I have to rewrite the query to include those field? What’s the right way to do it?
Just figured out my project is still powered by apollo server, I can still write field resolver. Having the powerful prisma server to delegate to somehow clouds the fact. I ended up with lots of code that assume I can only have a resolver for root field. Then I found I can still write resolver for sub field and solved the problem.