WooCommerce Code Reference

FieldsOnCorrectType extends ValidationRule
in package

Table of Contents

$name  : string
getName()  : string
getSDLVisitor()  : array<string|int, mixed>
Returns structure suitable for @see \Automattic\WooCommerce\Vendor\GraphQL\Language\Visitor.
getVisitor()  : array<string|int, mixed>
Returns structure suitable for @see \Automattic\WooCommerce\Vendor\GraphQL\Language\Visitor.
undefinedFieldMessage()  : string
getSuggestedFieldNames()  : array<int, string>
For the field name provided, determine if there are any similar field names that may be the result of a typo.
getSuggestedTypeNames()  : array<int, string>
Go through all implementations of a type, as well as the interfaces that it implements. If any of those types include the provided field, suggest them, sorted by how often the type is referenced, starting with interfaces.

Properties

Methods

undefinedFieldMessage()

public static undefinedFieldMessage(string $fieldName, string $type, array<string|int, string> $suggestedTypeNames, array<string|int, string> $suggestedFieldNames) : string
Parameters
$fieldName : string
$type : string
$suggestedTypeNames : array<string|int, string>
$suggestedFieldNames : array<string|int, string>
Return values
string

getSuggestedTypeNames()

Go through all implementations of a type, as well as the interfaces that it implements. If any of those types include the provided field, suggest them, sorted by how often the type is referenced, starting with interfaces.

protected getSuggestedTypeNames(Schema $schema, Type $type, string $fieldName) : array<int, string>
Parameters
$schema : Schema
$type : Type
$fieldName : string
Tags
throws
InvariantViolation
Return values
array<int, string>