Automattic\WooCommerce\Vendor\GraphQL\Utils
BuildClientSchema::buildImplementationsList
Method of the class: BuildClientSchema{}
No Hooks.
Returns
Array
Usage
// private - for code of main (parent) class only $result = $this->buildImplementationsList( $implementingIntrospection ): array;
- $implementingIntrospection(array) (required)
- .
BuildClientSchema::buildImplementationsList() BuildClientSchema::buildImplementationsList code WC 10.9.1
private function buildImplementationsList(array $implementingIntrospection): array
{
// TODO: Temporary workaround until Automattic\WooCommerce\Vendor\GraphQL ecosystem will fully support 'interfaces' on interface types.
if (
array_key_exists('interfaces', $implementingIntrospection)
&& $implementingIntrospection['interfaces'] === null
&& $implementingIntrospection['kind'] === TypeKind::INTERFACE
) {
return [];
}
if (! array_key_exists('interfaces', $implementingIntrospection)) {
$safeIntrospection = Utils::printSafeJson($implementingIntrospection);
throw new InvariantViolation("Introspection result missing interfaces: {$safeIntrospection}.");
}
return array_map(
[$this, 'getInterfaceType'],
$implementingIntrospection['interfaces']
);
}