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

A way to conditionally hide a field #1774

Open
gherciu opened this issue Feb 26, 2025 · 0 comments
Open

A way to conditionally hide a field #1774

gherciu opened this issue Feb 26, 2025 · 0 comments

Comments

@gherciu
Copy link

gherciu commented Feb 26, 2025

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?

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