Esempio n. 1
0
        protected virtual void VisitFragmentSpread(
            FragmentSpreadNode fragmentSpread,
            IType type,
            ImmutableStack <ISyntaxNode> path)
        {
            ImmutableStack <ISyntaxNode> newpath = path.Push(fragmentSpread);

            if (path.Last() is DocumentNode d)
            {
                string fragmentName = fragmentSpread.Name.Value;
                if (_visitedFragments.Add(fragmentName))
                {
                    IEnumerable <FragmentDefinitionNode> fragments = d.Definitions
                                                                     .OfType <FragmentDefinitionNode>()
                                                                     .Where(t => t.Name.Value.EqualsOrdinal(fragmentName));

                    foreach (FragmentDefinitionNode fragment in fragments)
                    {
                        VisitFragmentDefinition(fragment, newpath);
                    }
                }
            }

            VisitDirectives(fragmentSpread.Directives, newpath);
        }
 protected override void VisitFragmentSpread(
     FragmentSpreadNode fragmentSpread,
     IType type,
     ImmutableStack <ISyntaxNode> path)
 {
     if (path.Last() is DocumentNode d)
     {
         FragmentDefinitionNode fragment = d.Definitions
                                           .OfType <FragmentDefinitionNode>()
                                           .FirstOrDefault(t =>
                                                           t.Name.Value.EqualsOrdinal(fragmentSpread.Name.Value));
         if (fragment != null)
         {
             VisitFragmentDefinition(fragment, path.Push(fragmentSpread));
         }
     }
 }
Esempio n. 3
0
        protected virtual void VisitFragmentSpread(
            FragmentSpreadNode fragmentSpread,
            IType type,
            ImmutableStack <ISyntaxNode> path)
        {
            ImmutableStack <ISyntaxNode> newpath = path.Push(fragmentSpread);

            if (path.Last() is DocumentNode d)
            {
                string fragmentName = fragmentSpread.Name.Value;
                if (_fragments.TryGetValue(fragmentName,
                                           out FragmentDefinitionNode fragment))
                {
                    VisitFragmentDefinition(fragment, newpath);
                }
            }

            VisitDirectives(fragmentSpread.Directives, newpath);
        }
        protected override void VisitFragmentSpread(
            FragmentSpreadNode fragmentSpread,
            IType type,
            ImmutableStack <ISyntaxNode> path)
        {
            if (_cycleDetected)
            {
                return;
            }

            ImmutableStack <ISyntaxNode> newpath = path.Push(fragmentSpread);

            if (path.Last() is DocumentNode d)
            {
                string fragmentName = fragmentSpread.Name.Value;
                if (TryGetFragment(fragmentName,
                                   out FragmentDefinitionNode fragment))
                {
                    VisitFragmentDefinition(fragment, newpath);
                }
            }

            VisitDirectives(fragmentSpread.Directives, newpath);
        }