You are here

public function DataProducer::__construct in GraphQL 8.4

DataProducer constructor.

Parameters

array $values: The plugin annotation values.

Throws

\Doctrine\Common\Annotations\AnnotationException In case of missing required annotation values.

Overrides Plugin::__construct

File

src/Annotation/DataProducer.php, line 46

Class

DataProducer
Annotation for data producer plugins.

Namespace

Drupal\graphql\Annotation

Code

public function __construct(array $values) {
  if (!array_key_exists('id', $values) || !$values['id']) {
    throw new AnnotationException('The plugin is missing an "id" property.');
  }
  parent::__construct($values);
}