You are here

protected function SchemaPrinterTrait::getPrintedSchema in GraphQL 8.4

Gets printed version of the schema.

Parameters

\Drupal\graphql\Entity\ServerInterface $server: The server id.

Return value

string The printed version of the schema.

File

tests/src/Traits/SchemaPrinterTrait.php, line 22

Class

SchemaPrinterTrait
Trait to get printed version of the schema.

Namespace

Drupal\Tests\graphql\Traits

Code

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);
}