Automattic\WooCommerce\Vendor\GraphQL\Type

SchemaValidationContext::getAllFieldNodesprivateWC 1.0

Method of the class: SchemaValidationContext{}

No Hooks.

Returns

list.

Usage

// private - for code of main (parent) class only
$result = $this->getAllFieldNodes( $type, $fieldName ): array;
$type(ObjectType|InterfaceType) (required)
.
$fieldName(string) (required)
.

SchemaValidationContext::getAllFieldNodes() code WC 10.9.1

private function getAllFieldNodes(Type $type, string $fieldName): array
{
    $allNodes = array_filter([$type->astNode, ...$type->extensionASTNodes]);

    $matchingFieldNodes = [];

    foreach ($allNodes as $node) {
        foreach ($node->fields as $field) {
            if ($field->name->value === $fieldName) {
                $matchingFieldNodes[] = $field;
            }
        }
    }

    return $matchingFieldNodes;
}