A way to conditionally hide a field
Author: gherciuCreated Feb 26, 2025Updated Mar 6, 2025
LabelsQuestion :grey_question:Community :family_man_girl:Need More Info :man_shrugging:
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?
Source: MichalLytek/type-graphql