Automattic\WooCommerce\Vendor\GraphQL\Utils
SchemaExtender::getMergedDirectives
Метод класса: SchemaExtender{}
Хуков нет.
Возвращает
Массив
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->getMergedDirectives( $schema, $directiveDefinitions ): array;
- $schema(Schema) (обязательный)
- .
- $directiveDefinitions(array
) (обязательный) - .
Код SchemaExtender::getMergedDirectives() 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;
}