Automattic\WooCommerce\Vendor\GraphQL\Validator\Rules
FieldsOnCorrectType::getSuggestedFieldNames
For the field name provided, determine if there are any similar field names that may be the result of a typo.
Метод класса: FieldsOnCorrectType{}
Хуков нет.
Возвращает
Массив
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->getSuggestedFieldNames( $type, $fieldName ): array;
- $type(Type) (обязательный)
- .
- $fieldName(строка) (обязательный)
- .
Код FieldsOnCorrectType::getSuggestedFieldNames() FieldsOnCorrectType::getSuggestedFieldNames WC 10.9.1
protected function getSuggestedFieldNames(Type $type, string $fieldName): array
{
if ($type instanceof HasFieldsType) {
return Utils::suggestionList(
$fieldName,
$type->getFieldNames()
);
}
// Otherwise, must be a Union type, which does not define fields.
return [];
}