You are here

protected function MockGraphQLPluginTrait::addTypeSystemPlugin in GraphQL 8.3

Add a new plugin to the GraphQL type system.

@internal

Parameters

\Drupal\Component\Plugin\PluginInspectionInterface $plugin: The plugin to add.

File

tests/src/Traits/MockGraphQLPluginTrait.php, line 234

Class

MockGraphQLPluginTrait
Trait for mocking GraphQL type system plugins.

Namespace

Drupal\Tests\graphql\Traits

Code

protected function addTypeSystemPlugin(PluginInspectionInterface $plugin) {
  foreach ($this->graphQLPluginClassMap as $id => $class) {
    if ($plugin instanceof $class) {
      $this->graphQLPlugins[$id][$plugin
        ->getPluginId()] = $plugin;
    }
  }
}