Automattic\WooCommerce\Vendor\GraphQL\Type\Definition

IDType::parseValuepublicWC 1.0

Method of the class: IDType{}

No Hooks.

Returns

null. Nothing (null).

Usage

$IDType = new IDType();
$IDType->parseValue( $value ): string;
$value(required)
.

IDType::parseValue() code WC 10.9.4

public function parseValue($value): string
{
    if (is_string($value) || is_int($value)) {
        return (string) $value;
    }

    $notID = Utils::printSafeJson($value);
    throw new Error("ID cannot represent a non-string and non-integer value: {$notID}");
}