flipkart-incubator / Krystal

Apache License 2.0
8 stars 14 forks source link

#InferUsesAnnoFromParamName #206

Closed RamAnvesh closed 8 months ago

RamAnvesh commented 10 months ago

Vajram code generator should be able to infer the facet name inside @Uses annotation from the param name. This way the developer can avoid writing @Uses annotation again and again for complex resolvers

RamAnvesh commented 9 months ago

Some teams might prefer not have this in their codebase because they might feel @Uses annotation is more explicit. To allow this configuration, in future we might add @VajramCodeGenConfig(inferUsingFacetNamesFromParamNamesInResolvers = false) annotation which can be placed on a class, a package or module in decreasing order of precedence so that developers can opt-in or out of this feature. Default should be opt-in so that brevity is given precedence.