Automattic\WooCommerce\Vendor\GraphQL\Type

Schema::getDirectivepublicWC 1.0

Returns instance of directive by name.

Method of the class: Schema{}

No Hooks.

Returns

null. Nothing (null).

Usage

$Schema = new Schema();
$Schema->getDirective( $name ): ?Directive;
$name(string) (required)
.

Schema::getDirective() code WC 10.9.4

public function getDirective(string $name): ?Directive
{
    foreach ($this->getDirectives() as $directive) {
        if ($directive->name === $name) {
            return $directive;
        }
    }

    return null;
}