Beispiel #1
0
 public override INode VisitOperationDefinition(OperationDefinition node)
 {
     VisitList(node.VariableDefinitions);
     VisitList(node.Directives);
     Visit(node.SelectionSet);
     return(DefaultVisit(node));
 }
Beispiel #2
0
        public override string VisitOperationDefinition(OperationDefinition node)
        {
            var op           = node.Operation == OperationType.Query ? "query" : "mutation";
            var name         = Visit(node.Name);
            var defs         = Wrap("(", JoinNotNull(", ", VisitList(node.VariableDefinitions)), ")");
            var directives   = JoinNotNull(" ", VisitList(node.Directives));
            var selectionSet = Visit(node.SelectionSet);
            var nameDefsJoin = JoinNotNull("", name, defs);
            var res          = IsNullOrEmpty(name) ? selectionSet
                : JoinNotNull(" ", op, nameDefsJoin, directives, selectionSet);

            return(res);
        }
Beispiel #3
0
        public override INode VisitOperationDefinition(OperationDefinition node)
        {
            var updatedNode = EnterOperationDefinition(node);

            if (updatedNode == null)
            {
                return(null);
            }
            var name = Visit(updatedNode.Name);
            var variableDefinitions = VisitList(updatedNode.VariableDefinitions);
            var directives          = VisitList(updatedNode.Directives);
            var selectionSet        = Visit(updatedNode.SelectionSet);

            updatedNode = updatedNode.Update(node.Operation, name, variableDefinitions, directives, selectionSet);
            updatedNode = LeaveOperationDefinition(updatedNode);
            return(updatedNode);
        }
Beispiel #4
0
 public virtual OperationDefinition LeaveOperationDefinition(OperationDefinition operationDefinition)
 {
     return(Leave(operationDefinition));
 }
Beispiel #5
0
 public virtual OperationDefinition EnterOperationDefinition(OperationDefinition operationDefinition)
 {
     return(Enter(operationDefinition));
 }
Beispiel #6
0
 public virtual TResult VisitOperationDefinition(OperationDefinition node)
 {
     return(DefaultVisit(node));
 }