Automattic\WooCommerce\Vendor\GraphQL\Type

SchemaValidationContext::getUnionMemberTypeNodesprivateWC 1.0

Method of the class: SchemaValidationContext{}

No Hooks.

Returns

list.

Usage

// private - for code of main (parent) class only
$result = $this->getUnionMemberTypeNodes( $union, $typeName ): array;
$union(UnionType) (required)
.
$typeName(string) (required)
.

SchemaValidationContext::getUnionMemberTypeNodes() code WC 10.9.1

private function getUnionMemberTypeNodes(UnionType $union, string $typeName): array
{
    $allNodes = array_filter([$union->astNode, ...$union->extensionASTNodes]);

    $types = [];
    foreach ($allNodes as $node) {
        foreach ($node->types as $type) {
            if ($type->name->value === $typeName) {
                $types[] = $type;
            }
        }
    }

    return $types;
}