Exemplo n.º 1
0
        protected override ISyntaxVisitorAction Leave(
            OperationDefinitionNode node,
            IDocumentValidatorContext context)
        {
            context.Max = context.Count > context.Max ? context.Count : context.Max;

            if (_options.MaxAllowedExecutionDepth.HasValue &&
                _options.MaxAllowedExecutionDepth < context.Max)
            {
                context.Errors.Add(context.MaxExecutionDepth(
                                       node, _options.MaxAllowedExecutionDepth.Value, context.Max));
                return(Break);
            }

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