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

Preconfigured decorators aliases #577

Open
MichalLytek opened this issue Mar 14, 2020 · 0 comments
Open

Preconfigured decorators aliases #577

MichalLytek opened this issue Mar 14, 2020 · 0 comments
Labels
Enhancement 🆕 New feature or request
Milestone

Comments

@MichalLytek
Copy link
Owner

This feature is kind partial apply equivalent from functional programming paradigm.

It gives you an ability to create decorators that have some options binded,
like @NullableField() === @Field({ nullable: true }):

const NullableField = createDecoratorAlias(Field, { nullable: true });
const AbstractResolver = createDecoratorAlias(Resolver, { isAbstract: true });
const IntField = createDecoratorAlias(Field, type => Int);

This might help to avoid common boilerplate and also can be useful for other libraries integration purposes.

@MichalLytek MichalLytek added the Enhancement 🆕 New feature or request label Mar 14, 2020
@MichalLytek MichalLytek added this to the 1.x versions milestone Mar 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement 🆕 New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant