Download the PHP package infinityloop-dev/graphpinator-printer without Composer
On this page you can find all versions of the php package infinityloop-dev/graphpinator-printer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download infinityloop-dev/graphpinator-printer
More information about infinityloop-dev/graphpinator-printer
Files in infinityloop-dev/graphpinator-printer
Package graphpinator-printer
Short Description Schema printing visitor for GraPHPinator typesystem.
License MIT
Homepage https://github.com/graphpql/
Informations about the package graphpinator-printer
GraPHPinator Printer
:zap::globe_with_meridians::zap: Schema printing visitor for GraPHPinator typesystem.
Introduction
This library allows printing of the GraphQL schema into human-readable format. It supports multiple output formats and ordering options.
Installation
Install package using composer
How to use
Usage of this library is very simple.
Advanced configiration options (see description below)
Format
It is possible to implement additional printing mechanisms for various output formats.
This is done by implementing \Graphpinator\Printer\PrintComponentVisitor
and passing an instance to Printer
as first constructor argument.
Implementations provided by this library:
TextVisitor
(default) - standard mechanism which creates text outputHtmlVisitor
- mechanism which creates structured HTML code (there is also a SCSS bundled in thetheme
folder and compiled CSS inbuild
folder)
Implicit inheritance
Both formatters support Implicit inheritance RFC - option to exclude fields inherited from parent interface.
In order to enable implicit inheritance, it is needed to pass different FieldCollector
strategy to TextVisitor
or HtmlVisitor
.
Strategies provided by this library:
AllFieldCollector
(default) - standard strategy to print all fieldsImplicitInheritanceFieldCollector
- strategy to leverage Implicit inheritance RFC, inherited fields which remained the same are excluded
Order of types
It is possible to change the order of types/directives in output.
This is done by implementing \Graphpinator\Printer\Sorter
and passing an instance to Printer
as second constructor argument.
Implementations provided by this library:
AlphabeticalSorter
(default) - sorts types and directives alphabeticallyTypeKindSorter
- sorts types by their TypeKind (and then alphabetically) - interfaces first, then object types, then unions, ..., directives last