Automattic\WooCommerce\Vendor\GraphQL\Utils

SchemaExtender::getMergedDirectivesprotectedWC 1.0

Метод класса: SchemaExtender{}

Хуков нет.

Возвращает

Массив. Directive>

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->getMergedDirectives( $schema, $directiveDefinitions ): array;
$schema(Schema) (обязательный)
.
$directiveDefinitions(array) (обязательный)
.

Код SchemaExtender::getMergedDirectives() WC 11.0.1

protected function getMergedDirectives(Schema $schema, array $directiveDefinitions): array
{
    $directives = array_map(
        [$this, 'extendDirective'],
        $schema->getDirectives()
    );

    if ($directives === []) {
        throw new InvariantViolation('Schema must have default directives.');
    }

    foreach ($directiveDefinitions as $directive) {
        $directives[] = $this->astBuilder->buildDirective($directive);
    }

    return $directives;
}