Automattic\WooCommerce\Vendor\GraphQL\Utils
SchemaExtender::getMergedDirectives
Method of the class: SchemaExtender{}
No Hooks.
Returns
Array
Usage
// protected - for code of main (parent) or child class $result = $this->getMergedDirectives( $schema, $directiveDefinitions ): array;
- $schema(Schema) (required)
- .
- $directiveDefinitions(array
) (required) - .
SchemaExtender::getMergedDirectives() SchemaExtender::getMergedDirectives code WC 10.9.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;
}