You are here

protected function MockGraphQLPluginTrait::getTypeSystemPluginDefinition in GraphQL 8.3

Get a plugin definition.

Merges plugin definition with the default values for a specified annotation class.

@internal

Parameters

string $annotationClass: The plugin annotation class name.

array $definition: The definition values.

Return value

array The complete plugin definition.

7 calls to MockGraphQLPluginTrait::getTypeSystemPluginDefinition()
MockGraphQLPluginTrait::mockEnum in tests/src/Traits/MockGraphQLPluginTrait.php
Mock a GraphQL enum.
MockGraphQLPluginTrait::mockField in tests/src/Traits/MockGraphQLPluginTrait.php
Mock a GraphQL field.
MockGraphQLPluginTrait::mockInputType in tests/src/Traits/MockGraphQLPluginTrait.php
Mock a GraphQL input type.
MockGraphQLPluginTrait::mockInterface in tests/src/Traits/MockGraphQLPluginTrait.php
Mock a GraphQL interface.
MockGraphQLPluginTrait::mockMutation in tests/src/Traits/MockGraphQLPluginTrait.php
Mock a GraphQL mutation.

... See full list

File

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

Class

MockGraphQLPluginTrait
Trait for mocking GraphQL type system plugins.

Namespace

Drupal\Tests\graphql\Traits

Code

protected function getTypeSystemPluginDefinition($annotationClass, array $definition) {
  return (new $annotationClass($definition))
    ->get();
}