Automattic\WooCommerce\Vendor\GraphQL\Type\Definition

IDType::parseLiteralpublicWC 1.0

Метод класса: IDType{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$IDType = new IDType();
$IDType->parseLiteral( $valueNode, ?array $variables ): string;
$valueNode(Node) (обязательный)
.
?array $variables
.
По умолчанию: null

Код IDType::parseLiteral() WC 10.9.1

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

    $notID = Printer::doPrint($valueNode);
    throw new Error("ID cannot represent a non-string and non-integer value: {$notID}", $valueNode);
}