You are here

public function UnionTypePluginBase::getDefinition in GraphQL 8.3

Returns the plugin's type or field definition for the schema.

Return value

array The type or field definition of the plugin.

Overrides TypePluginInterface::getDefinition

File

src/Plugin/GraphQL/Unions/UnionTypePluginBase.php, line 41

Class

UnionTypePluginBase

Namespace

Drupal\graphql\Plugin\GraphQL\Unions

Code

public function getDefinition() {
  $definition = $this
    ->getPluginDefinition();
  return [
    'name' => $definition['name'],
    'description' => $this
      ->buildDescription($definition),
    'types' => $this
      ->buildTypes($definition),
  ];
}