You are here

public function FieldPluginBase::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 FieldPluginInterface::getDefinition

File

src/Plugin/GraphQL/Fields/FieldPluginBase.php, line 98

Class

FieldPluginBase

Namespace

Drupal\graphql\Plugin\GraphQL\Fields

Code

public function getDefinition() {
  $definition = $this
    ->getPluginDefinition();
  return [
    'type' => $this
      ->buildType($definition),
    'description' => $this
      ->buildDescription($definition),
    'args' => $this
      ->buildArguments($definition),
    'deprecationReason' => $this
      ->buildDeprecationReason($definition),
    'contexts' => $this
      ->buildCacheContexts($definition),
  ];
}