C# Class GraphQL.Validation.Rules.FieldsOnCorrectType

Fields on correct type A GraphQL document is only valid if all fields selected are defined by the parent type, or are an allowed meta field such as __typename
Inheritance: IValidationRule
Afficher le fichier Open project: graphql-dotnet/graphql-dotnet

Méthodes publiques

Méthode Description
UndefinedFieldMessage ( string fieldName, string type, IEnumerable suggestedTypeNames, IEnumerable suggestedFieldNames ) : string
Validate ( ValidationContext context ) : INodeVisitor

Private Methods

Méthode Description
getSuggestedFieldNames ( IGraphType type, string fieldName ) : IEnumerable

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

getSuggestedTypeNames ( ISchema schema, IGraphType type, string fieldName ) : IEnumerable

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.

Method Details

UndefinedFieldMessage() public méthode

public UndefinedFieldMessage ( string fieldName, string type, IEnumerable suggestedTypeNames, IEnumerable suggestedFieldNames ) : string
fieldName string
type string
suggestedTypeNames IEnumerable
suggestedFieldNames IEnumerable
Résultat string

Validate() public méthode

public Validate ( ValidationContext context ) : INodeVisitor
context ValidationContext
Résultat INodeVisitor