You are here

protected function SchemaPluginBase::buildSubscription in GraphQL 8.3

Retrieves the subscription definition for a given field reference.

Parameters

array $mutation: The subscription reference.

Return value

array The subscription definition.

File

src/Plugin/GraphQL/Schemas/SchemaPluginBase.php, line 544

Class

SchemaPluginBase

Namespace

Drupal\graphql\Plugin\GraphQL\Schemas

Code

protected function buildSubscription($subscription) {
  if (!isset($this->subscriptions[$subscription['id']])) {
    $creator = [
      $subscription['class'],
      'createInstance',
    ];
    $this->subscriptions[$subscription['id']] = $creator($this, $this->subscriptionManager, $subscription['definition'], $subscription['id']);
  }
  return $this->subscriptions[$subscription['id']];
}