Skip to content

A way to conditionally hide a field #1774

@gherciu

Description

@gherciu

Describe the issue
I did read the docs but could not find any feature to conditionally hide a field.

I have a simple use case, Each user in my DB has a email, now in some cases I want to return it in Graphql response and in some not, what is the best way to implement it?

Should that be done just in the resolver, or is there a type-graphql Decorator to hide a field conditionally?
Or maybe I should use a FieldResolver and it will override the original return with what I want?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions