You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got userType that represents the viewer. I'm also using this type when getting viewer's friends.
But some fields are only related to viewer. For example, chatMessageSound: bool, notificationsEmail: bool. So it doesn't make sense to return those fields if it has been queried from friends field.
How to deal with this?
I can check it and return null for all those fields but it isn't best way to do that, so I should convert all non-nullable fields to back.
I also don't want to create seperate 2 types because they have many common fields.
Is there a way to implement it with inheritence?
The text was updated successfully, but these errors were encountered:
I've got
userType
that represents the viewer. I'm also using this type when getting viewer's friends.But some fields are only related to viewer. For example,
chatMessageSound: bool, notificationsEmail: bool
. So it doesn't make sense to return those fields if it has been queried fromfriends
field.How to deal with this?
I can check it and return null for all those fields but it isn't best way to do that, so I should convert all non-nullable fields to back.
I also don't want to create seperate 2 types because they have many common fields.
Is there a way to implement it with inheritence?
The text was updated successfully, but these errors were encountered: