Automattic\WooCommerce\Vendor\GraphQL\Type

SchemaValidationContext::getAllDirectiveArgNodesprivateWC 1.0

Method of the class: SchemaValidationContext{}

No Hooks.

Returns

Array. InputValueDefinitionNode>

Usage

// private - for code of main (parent) class only
$result = $this->getAllDirectiveArgNodes( $directive, $argName ): array;
$directive(Directive) (required)
.
$argName(string) (required)
.

SchemaValidationContext::getAllDirectiveArgNodes() code WC 10.9.1

private function getAllDirectiveArgNodes(Directive $directive, string $argName): array
{
    $astNode = $directive->astNode;
    if ($astNode === null) {
        return [];
    }

    $matchingSubnodes = [];
    foreach ($astNode->arguments as $subNode) {
        if ($subNode->name->value === $argName) {
            $matchingSubnodes[] = $subNode;
        }
    }

    return $matchingSubnodes;
}