Automattic\WooCommerce\Vendor\GraphQL\Type\Definition

BooleanType::parseLiteralpublicWC 1.0

Method of the class: BooleanType{}

No Hooks.

Returns

null. Nothing (null).

Usage

$BooleanType = new BooleanType();
$BooleanType->parseLiteral( $valueNode, ?array $variables ): bool;
$valueNode(Node) (required)
.
?array $variables
.
Default: null

BooleanType::parseLiteral() code WC 10.9.1

public function parseLiteral(Node $valueNode, ?array $variables = null): bool
{
    if ($valueNode instanceof BooleanValueNode) {
        return $valueNode->value;
    }

    $notBoolean = Printer::doPrint($valueNode);
    throw new Error("Boolean cannot represent a non boolean value: {$notBoolean}", $valueNode);
}