WorksHub / leona

spec -> lacinia schema
Eclipse Public License 1.0
36 stars 17 forks source link

Fix unqualified name clashes when injecting field resolvers #46

Closed acron0 closed 4 years ago

acron0 commented 4 years ago

The problem: Injecting field resolvers was achieved by matching unqualified names which meant there was a high possibility for clashes (in fact, we have encountered and had to work around clashes in our app). When a clash occurs, the field gets one of the field resolvers at random (probably not random but should be considered so).

The solution: We need to match field resolvers based on specs, not unqualified names (Leona is entirely spec-driven after all). In order to achieve this we have to carry spec definitions throughout the entire transformation process and make them part of the pre-compiled data structure. When field resolvers are injected we can then use these specs.