예제 #1
0
        public override string VisitFragmentDefinition(FragmentDefinition node)
        {
            var name             = VisitName(node.Name);
            var typeCondition    = Visit(node.TypeCondition);
            var directives       = JoinNotNull(" ", VisitList(node.Directives));
            var selectionSet     = Visit(node.SelectionSet);
            var fragmentFragment = $"fragment {name} on {typeCondition} {Wrap("", directives, " ")}{selectionSet}";

            return(fragmentFragment);
        }
예제 #2
0
        public override INode VisitFragmentDefinition(FragmentDefinition node)
        {
            var updatedNode = EnterFragmentDefinition(node);

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

            updatedNode = updatedNode.Update(name, typeCondition, directives, selectionSet);
            updatedNode = LeaveFragmentDefinition(updatedNode);
            return(updatedNode);
        }
예제 #3
0
 public virtual TResult VisitFragmentDefinition(FragmentDefinition node)
 {
     return(DefaultVisit(node));
 }
예제 #4
0
 public virtual FragmentDefinition LeaveFragmentDefinition(FragmentDefinition fragmentDefinition)
 {
     return(Leave(fragmentDefinition));
 }
예제 #5
0
 public virtual FragmentDefinition EnterFragmentDefinition(FragmentDefinition fragmentDefinition)
 {
     return(Enter(fragmentDefinition));
 }