Automattic\WooCommerce\Vendor\GraphQL\Type\Definition

Directive::includeDirectivepublic staticWC 1.0

Method of the class: Directive{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = Directive::includeDirective(): Directive;

Directive::includeDirective() code WC 10.9.1

public static function includeDirective(): Directive
{
    return self::$internalDirectives[self::INCLUDE_NAME] ??= new self([
        'name' => self::INCLUDE_NAME,
        'description' => 'Directs the executor to include this field or fragment only when the `if` argument is true.',
        'locations' => [
            DirectiveLocation::FIELD,
            DirectiveLocation::FRAGMENT_SPREAD,
            DirectiveLocation::INLINE_FRAGMENT,
        ],
        'args' => [
            self::IF_ARGUMENT_NAME => [
                'type' => Type::nonNull(Type::boolean()),
                'description' => 'Included when true.',
            ],
        ],
    ]);
}