trait SchemaPrinterTrait in GraphQL 8.4
Trait to get printed version of the schema.
Hierarchy
- trait \Drupal\Tests\graphql\Traits\SchemaPrinterTrait
1 file declares its use of SchemaPrinterTrait
- GraphQLTestBase.php in tests/
src/ Kernel/ GraphQLTestBase.php
File
- tests/
src/ Traits/ SchemaPrinterTrait.php, line 11
Namespace
Drupal\Tests\graphql\TraitsView source
trait SchemaPrinterTrait {
/**
* Gets printed version of the schema.
*
* @param \Drupal\graphql\Entity\ServerInterface $server
* The server id.
*
* @return string
* The printed version of the schema.
*/
protected function getPrintedSchema(ServerInterface $server = NULL) {
$server = $server ?? $this->server;
/** @var \GraphQL\Server\ServerConfig $config */
$config = $server
->configuration();
$schema = $config
->getSchema();
return SchemaPrinter::doPrint($schema);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SchemaPrinterTrait:: |
protected | function | Gets printed version of the schema. |