Skip to content

Inheritence or similar technique #1287

Closed
@noone0012

Description

@noone0012

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions