Hacker News new | ask | show | jobs
by msbarnett 2615 days ago
Anonymization vs “just use a demo database” (which I tend to agree with) aside, there’s significant value, at least, in illustrating the concept of Decorators as a pattern for transforming data for presentation, and how that can be hoisted into a transformation of the resolvers’ results to apply them automatically. I’ve seen way too many codebases dumbly copy-and-pasting identical logic like this between each and every resolver, with all of the attendant “whoops, forgot a place” bugs.

There’s seemingly a real lack of knowledge of either the existence of better abstractions or the knowledge of how they can be applied in GraphQL implementations in a lot of shops, currently.