Skip to content

1.1.0-beta.1

Pre-release
Pre-release

Choose a tag to compare

@hsehweil hsehweil released this 20 Oct 19:21
Rewrite of conditional printing with directives (#13)

The GraphQL schema printer drops directives (with the exception of
deprecated). This commit offers an alternative printers that will leave
directives intact. Because our tool is merging and validating multiple
schemas (stitching), to represent to some evaluation layer, we want
those directives to be preserved on output.

We utilize GQL's AST api where possible because all directives are
intact in the AST, even if not directly represented in the Fields. The
AST approach should be extensible for more directive types.

This feature is most likely not complete. It handles a subset of all
places directives can apply on the tree, but it is a start and handles
all known tracking issues (and tests to demonstrate).

Again, bear in mind that 'deprecated' is a special case. In the tests,
you will see that the withoutDirective fixtures still include
deprecated, which is modeled as a first class directive by the GQL core
code base.