You are here

public function SchemaTest::testValidSchema in Thunder 6.2.x

Validates the thunder schema.

File

modules/thunder_gqls/tests/src/Functional/SchemaTest.php, line 168

Class

SchemaTest
Test the schema.

Namespace

Drupal\Tests\thunder_gqls\Functional

Code

public function testValidSchema() {

  /** @var \Drupal\graphql\GraphQL\ValidatorInterface $validator */
  $validator = \Drupal::service('graphql.validator');

  /** @var \Drupal\graphql\Entity\ServerInterface $server */
  $server = \Drupal::entityTypeManager()
    ->getStorage('graphql_server')
    ->load('thunder_graphql');
  $this
    ->assertEmpty($validator
    ->validateSchema($server), "The schema 'thunder_graphql' is not valid.");
  $this
    ->assertEmpty($validator
    ->getOrphanedResolvers($server), "The schema 'thunder_graphql' contains orphaned resolvers.");
  $this
    ->assertEmpty($validator
    ->getMissingResolvers($server), "The schema 'thunder_graphql' contains types without a resolver.");
}