Automattic\WooCommerce\Vendor\GraphQL\Validator\Rules

OneOfInputObjectsRule::oneOfInputObjectExpectedExactlyOneFieldMessagepublic staticWC 1.0

Method of the class: OneOfInputObjectsRule{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = OneOfInputObjectsRule::oneOfInputObjectExpectedExactlyOneFieldMessage( $typeName, ?int $providedCount ): string;
$typeName(string) (required)
.
?int $providedCount
.
Default: null

OneOfInputObjectsRule::oneOfInputObjectExpectedExactlyOneFieldMessage() code WC 10.9.1

public static function oneOfInputObjectExpectedExactlyOneFieldMessage(string $typeName, ?int $providedCount = null): string
{
    if ($providedCount === null) {
        return "OneOf input object '{$typeName}' must specify exactly one field.";
    }

    return "OneOf input object '{$typeName}' must specify exactly one field, but {$providedCount} fields were provided.";
}