Defining GraphQL Transformers
GraphQL transformers work by using directives and types from one schema to generate a new, improved schema together with backend resolvers. The principle of this solution is that each type, field, and argument can have a directive associated with it, which tells the transforming tool how to generate GraphQL code based on the information from the original schema and the directives.
Now, the original intention of this chapter was to describe several commercial solutions of directive libraries that allow us to transform GraphQL schemas. And yet, surprisingly, most of them disappeared from the market while writing this book. Does this mean that this technology is obsolete? No. Fortunately, there are still some options available.
Therefore, in this chapter, we will describe popular transformer techniques, before creating our own transformer. This will help you understand how it is possible to transform a GraphQL schema to the output schema and generated...