PHPackages                             lastdragon-ru/graphql-printer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. lastdragon-ru/graphql-printer

ActiveLibrary[API Development](/categories/api)

lastdragon-ru/graphql-printer
=============================

The package allows you to print GraphQL Schema and Queries in a highly customized way eg you can choose indent size, print only used/wanted/all types, print only one type, print used/wanted/all directives and even check which types/directives are used in the Schema/Query.

11.1.0(1mo ago)08513MITPHPPHP ^8.4|^8.5

Since Mar 20Pushed 1mo agoCompare

[ Source](https://github.com/LastDragon-ru/graphql-printer)[ Packagist](https://packagist.org/packages/lastdragon-ru/graphql-printer)[ Docs](https://github.com/LastDragon-ru/php-packages)[ RSS](/packages/lastdragon-ru-graphql-printer/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (32)Versions (53)Used By (3)

GraphQL Printer
===============

[](#graphql-printer)

The package allows you to print GraphQL Schema and Queries in a highly customized way eg you can choose indent size, print only used/wanted/all types, print only one type, print used/wanted/all directives ([it is not possible with standard printer](https://github.com/webonyx/graphql-php/issues/552)) and even check which types/directives are used in the Schema/Query.

Requirements
============

[](#requirements)

RequirementConstraintSupported byPHP`^8.5``HEAD ⋯ 11.0.0``^8.4``HEAD ⋯ 8.0.0``^8.3``10.3.0 ⋯ 5.0.0``^8.2``7.2.0 ⋯ 3.0.0``^8.1``6.4.2 ⋯ 3.0.0``^8.0``4.6.0 ⋯ 3.0.0``webonyx/graphql-php``^15.32.3``HEAD` , `11.1.0``^15.31.5``11.0.0``^15.4.0``10.3.0 ⋯ 4.2.1``^15.2.4``4.2.0 ⋯ 4.0.0``^14.11.9``3.0.0`Installation
============

[](#installation)

```
composer require lastdragon-ru/graphql-printer
```

Usage
=====

[](#usage)

There are two primary methods: `Printer::print()` and `Printer::export()`. The `print()` will print the current type only, meanwhile `export()` will print the current type and all used types/directives:

```
