{"id":20111920,"url":"https://github.com/graphpql/graphpinator-printer","last_synced_at":"2025-05-06T11:31:30.663Z","repository":{"id":50070336,"uuid":"338585455","full_name":"graphpql/graphpinator-printer","owner":"graphpql","description":":zap::globe_with_meridians::zap: Schema printing visitor for GraPHPinator typesystem.","archived":false,"fork":false,"pushed_at":"2023-11-10T13:05:54.000Z","size":359,"stargazers_count":3,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-12T21:52:14.127Z","etag":null,"topics":["graphql","graphql-php","php"],"latest_commit_sha":null,"homepage":"https://github.com/graphpql","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/graphpql.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null}},"created_at":"2021-02-13T13:52:46.000Z","updated_at":"2023-12-02T13:59:35.000Z","dependencies_parsed_at":"2023-11-10T14:28:04.952Z","dependency_job_id":"748b95e4-60b5-49b6-8d04-0f774b1be717","html_url":"https://github.com/graphpql/graphpinator-printer","commit_stats":null,"previous_names":["graphpql/graphpinator-printer"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphpql%2Fgraphpinator-printer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphpql%2Fgraphpinator-printer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphpql%2Fgraphpinator-printer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphpql%2Fgraphpinator-printer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphpql","download_url":"https://codeload.github.com/graphpql/graphpinator-printer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224499994,"owners_count":17321616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graphql","graphql-php","php"],"created_at":"2024-11-13T18:18:12.558Z","updated_at":"2024-11-13T18:18:13.167Z","avatar_url":"https://github.com/graphpql.png","language":"PHP","readme":"# GraPHPinator Printer [![PHP](https://github.com/graphpql/graphpinator-printer/actions/workflows/php.yml/badge.svg)](https://github.com/graphpql/graphpinator-printer/actions/workflows/php.yml) [![codecov](https://codecov.io/gh/infinityloop-dev/graphpinator-printer/branch/master/graph/badge.svg)](https://codecov.io/gh/infinityloop-dev/graphpinator-printer)\n\n:zap::globe_with_meridians::zap: Schema printing visitor for GraPHPinator typesystem.\n\n## Introduction\n\nThis library allows printing of the GraphQL schema into human-readable format. It supports multiple output formats and ordering options.\n\n## Installation\n\nInstall package using composer\n\n```composer require infinityloop-dev/graphpinator-printer```\n\n## How to use\n\nUsage of this library is very simple.\n\n```php\n$schema; // instance of \\Graphpinator\\Typesystem\\Schema\n$printer = new \\Graphpinator\\Printer\\Printer();\n\necho $printer-\u003eprintSchema($schema);\n```\n\nAdvanced configiration options (see description below)\n\n```php\n$schema; // instance of \\Graphpinator\\Typesystem\\Schema\n$printer = new \\Graphpinator\\Printer\\Printer(\n    new \\Graphpinator\\Printer\\HtmlVisitor( // different format\n        new \\Graphpinator\\Printer\\ImplicitInheritanceFieldCollector(), // enable implicit inheritance\n    ),\n    new \\Graphpinator\\Printer\\TypeKindSorter(), // different sorter\n);\n\necho $printer-\u003eprintSchema($schema);\n```\n\n\n### Format\n\nIt is possible to implement additional printing mechanisms for various output formats.\nThis is done by implementing `\\Graphpinator\\Printer\\PrintComponentVisitor` and passing an instance to `Printer` as first constructor argument.\n\n#### Implementations provided by this library:\n\n- `TextVisitor` (default) - standard mechanism which creates text output\n- `HtmlVisitor` - mechanism which creates structured HTML code (there is also a SCSS bundled in the `theme` folder and compiled CSS in `build` folder)\n\n### Implicit inheritance\n\nBoth formatters support Implicit inheritance RFC - option to exclude fields inherited from parent interface.\nIn order to enable implicit inheritance, it is needed to pass different `FieldCollector` strategy to `TextVisitor` or `HtmlVisitor`.\n\n#### Strategies provided by this library:\n\n- `AllFieldCollector` (default) - standard strategy to print all fields\n- `ImplicitInheritanceFieldCollector` - strategy to leverage Implicit inheritance RFC, inherited fields which remained the same are excluded \n\n### Order of types\n\nIt is possible to change the order of types/directives in output.\nThis is done by implementing `\\Graphpinator\\Printer\\Sorter` and passing an instance to `Printer` as second constructor argument.\n\n#### Implementations provided by this library:\n\n- `AlphabeticalSorter` (default) - sorts types and directives alphabetically\n- `TypeKindSorter` - sorts types by their TypeKind (and then alphabetically) - interfaces first, then object types, then unions, ..., directives last\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphpql%2Fgraphpinator-printer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphpql%2Fgraphpinator-printer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphpql%2Fgraphpinator-printer/lists"}