Documentation

FieldsOnCorrectType extends ValidationRule
in package

Table of Contents

$name  : string
__invoke()  : mixed
getName()  : mixed
getSDLVisitor()  : array<string|int, mixed>
Returns structure suitable for GraphQL\Language\Visitor
getVisitor()  : array<string|int, mixed>
Returns structure suitable for GraphQL\Language\Visitor
undefinedFieldMessage()  : string
getSuggestedFieldNames()  : array<string|int, mixed>|array<string|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<string|int, string>
Go through all of the implementations of type, as well as the interfaces that they implement. 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

getSuggestedFieldNames()

For the field name provided, determine if there are any similar field names that may be the result of a typo.

private getSuggestedFieldNames(Schema $schema, ObjectType|InterfaceType $type, string $fieldName) : array<string|int, mixed>|array<string|int, string>
Parameters
$schema : Schema
$type : ObjectType|InterfaceType
$fieldName : string
Return values
array<string|int, mixed>|array<string|int, string>

getSuggestedTypeNames()

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

private getSuggestedTypeNames(Schema $schema, ObjectType|InterfaceType $type, string $fieldName) : array<string|int, string>
Parameters
$schema : Schema
$type : ObjectType|InterfaceType
$fieldName : string
Return values
array<string|int, string>

Search results