Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inheritence or similar technique #1287

Closed
noone0012 opened this issue Mar 13, 2018 · 0 comments
Closed

Inheritence or similar technique #1287

noone0012 opened this issue Mar 13, 2018 · 0 comments

Comments

@noone0012
Copy link

noone0012 commented Mar 13, 2018

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant