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
$name
protected
string
$name
Methods
getName()
public
getName() : string
Return values
string —getSDLVisitor()
Returns structure suitable for @see \Automattic\WooCommerce\Vendor\GraphQL\Language\Visitor.
public
getSDLVisitor(SDLValidationContext $context) : array<string|int, mixed>
Parameters
- $context : SDLValidationContext
Tags
Return values
array<string|int, mixed> —getVisitor()
Returns structure suitable for @see \Automattic\WooCommerce\Vendor\GraphQL\Language\Visitor.
public
getVisitor(QueryValidationContext $context) : array<string|int, mixed>
Parameters
- $context : QueryValidationContext
Return values
array<string|int, mixed> —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 —getSuggestedFieldNames()
For the field name provided, determine if there are any similar field names that may be the result of a typo.
protected
getSuggestedFieldNames(Type $type, string $fieldName) : array<int, string>
Parameters
- $type : Type
- $fieldName : string
Tags
Return values
array<int, 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>
