Lets say I got a user Type
class UserType(DjangoObjectType):
class Meta:
model = User
fields = [
"fieldA",
"fieldB",
"relationshipA",
"relationshipB"
]
And I want fieldB
and relationshipB
to be visible only to the owner (user).
What is the best strategy to do this?
Initially Ive created a PublicUserType
excluding private fields, but quickly I realized that it might not be scalable because not only I'll have to create private representation for UserType
I'll might also create private representation for any relationship (relationshipA
etc), and proper resolvers, and duplicate fragments etc.
Is there a best practice here?