benawad / type-graphql-series

Typescript GraphQL Server built with TypeGraphQL
326 stars 129 forks source link

Decorators/single #4

Open paean99 opened 5 years ago

paean99 commented 5 years ago

Saw your video about Higher Order Resolvers and your question about dynamic decorators. I grabbed the opportunity to try it and learn more about decorators.

This code is to exemplify the passing of a single dynamic decorator.

About the abstract doubt in the last part of the video. I haven't tried it, but i don't think that you can instantiate an abstract class, so your code should be correct as it is.

I will send another PR for the array of decorators situation. I could have put everything in a single PR. But in my explorations, i separated the features in different branches as i got them to not mangle them.

Edit: disregard the earlier closing of the PR. It is late here :(