Automattic\WooCommerce\Vendor\GraphQL\Validator\Rules
OverlappingFieldsCanBeMerged::fieldFingerprint
Method of the class: OverlappingFieldsCanBeMerged{}
No Hooks.
Returns
null. Nothing (null).
Usage
// protected - for code of main (parent) or child class $result = $this->fieldFingerprint( $field ): string;
- $field(array) (required)
- .
OverlappingFieldsCanBeMerged::fieldFingerprint() OverlappingFieldsCanBeMerged::fieldFingerprint code WC 10.9.1
protected function fieldFingerprint(array $field): string
{
[$parentType, $ast] = $field;
$parentTypeId = $parentType !== null
? spl_object_id($parentType)
: '';
$name = $ast->name->value;
$selectionSetId = $ast->selectionSet !== null
? spl_object_id($ast->selectionSet)
: '';
$fingerprint = "{$parentTypeId}:{$name}:{$selectionSetId}";
foreach ($ast->arguments as $argument) {
$fingerprint .= ":{$argument->name->value}=" . Printer::doPrint($argument->value);
}
return $fingerprint;
}