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

Enabled/disabled toggle on decorators #2847

Closed
1 task done
kbariotis opened this issue May 30, 2023 · 3 comments
Closed
1 task done

Enabled/disabled toggle on decorators #2847

kbariotis opened this issue May 30, 2023 · 3 comments
Labels

Comments

@kbariotis
Copy link

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

I would like to be able to control the output GraphQL schema during boot time through some configuration variables.

Describe the solution you'd like

Given that these configuration variables can be environment variables or something else, common decorators like Field and ResolveField and Directive can accept an Enabled variable that will add them or not in the output GraphQL schema.

Teachability, documentation, adoption, migration strategy

Happy to write the needed documentation (or even help with implementation)

What is the motivation / use case for changing the behavior?

For doing incremental builds and production releases based on environment configuration variables.

@kbariotis kbariotis changed the title Enabled/disable toggle on decorators Enabled/disabled toggle on decorators May 30, 2023
@kbariotis
Copy link
Author

Hey all 👋, I hope the description is enough, if not please let me know. I would be happy to help with the implementation as well.

@raphaelkieling
Copy link

I didn't tried with graphql fields but in theory you can wrap those fields in a custom decorator and apply you custom logic, i had a similar case doing it using the swagger decorators fields.

@kamilmysliwiec
Copy link
Member

Thanks for your suggestion!

There are no plans to implement it in the foreseeable future.

If you think your request could live outside Nest's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.

@nestjs nestjs locked and limited conversation to collaborators Oct 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants