Validation

Specification

Execution


        private ValidationResult Validate(
            GraphQLDocument document,
            CombineRule rule,
            Dictionary<string, object> variables = null)
        {
            if (document == null) throw new ArgumentNullException(nameof(document));
            if (rule == null) throw new ArgumentNullException(nameof(rule));

            return Validator.Validate(           
                new[] {rule},
                Schema,
                document,
                variables);
        }

Rules

All execution rules

All = new[]
        {
            R511ExecutableDefinitions(),
            
            R5211OperationNameUniqueness(),
            R5221LoneAnonymousOperation(),
            R5231SingleRootField(),
            
            R531FieldSelections(),
            R532FieldSelectionMerging(),
            R533LeafFieldSelections(),

            R541ArgumentNames(),
            R542ArgumentUniqueness(),
            R5421RequiredArguments(),

            R5511FragmentNameUniqueness(),
            R5512FragmentSpreadTypeExistence(),
            R5513FragmentsOnCompositeTypes(),
            R5514FragmentsMustBeUsed(),

            R5521FragmentSpreadTargetDefined(),
            R5522FragmentSpreadsMustNotFormCycles(),
            R5523FragmentSpreadIsPossible(),

            R561ValuesOfCorrectType(),
            R562InputObjectFieldNames(),
            R563InputObjectFieldUniqueness(),
            R564InputObjectRequiredFields(),
            
            R571And573Directives(),
            R572DirectivesAreInValidLocations(),

            R581And582Variables(),
            //todo: 5.8.3 All Variable Uses Defined
            R584AllVariablesUsed(),
            R585AllVariableUsagesAreAllowed(),
            
        }