Automattic\WooCommerce\Vendor\GraphQL\Utils
SchemaExtender::extendImplementedInterfaces
Method of the class: SchemaExtender{}
No Hooks.
Returns
Array
Usage
// protected - for code of main (parent) or child class $result = $this->extendImplementedInterfaces( $type ): array;
- $type(ObjectType|InterfaceType) (required)
- .
SchemaExtender::extendImplementedInterfaces() SchemaExtender::extendImplementedInterfaces code WC 10.9.1
protected function extendImplementedInterfaces(ImplementingType $type): array
{
$interfaces = array_map(
[$this, 'extendNamedType'],
$type->getInterfaces()
);
if (isset($this->typeExtensionsMap[$type->name])) {
foreach ($this->typeExtensionsMap[$type->name] as $extension) {
assert(
$extension instanceof ObjectTypeExtensionNode || $extension instanceof InterfaceTypeExtensionNode,
'proven by schema validation'
);
foreach ($extension->interfaces as $namedType) {
$interface = $this->astBuilder->buildType($namedType);
assert($interface instanceof InterfaceType, 'we know this, but PHP templates cannot express it');
$interfaces[] = $interface;
}
}
}
return $interfaces;
}