예제 #1
0
        protected override ISyntaxVisitorAction Leave(
            OperationDefinitionNode node,
            IDocumentValidatorContext context)
        {
            if (context.FieldSets.Count > 0)
            {
                TryMergeFieldsInSet(context, context.FieldSets[node.SelectionSet]);
            }

            if (node.SelectionSet.Selections.Count == 0)
            {
                context.Errors.Add(context.NoSelectionOnRootType(
                                       node,
                                       context.Schema.GetOperationType(node.Operation)));
            }

            return(base.Leave(node, context));
        }