File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,15 @@ def get_fragment_spreads(self, node):
100100 spreads = self ._fragment_spreads .get (node )
101101 if not spreads :
102102 spreads = []
103- self .gather_spreads (spreads , node .selection_set )
103+ sets_to_visit = [node .selection_set ]
104+ while sets_to_visit :
105+ _set = sets_to_visit .pop ()
106+ for selection in _set .selections :
107+ if isinstance (selection , FragmentSpread ):
108+ spreads .append (selection )
109+ elif selection .selection_set :
110+ sets_to_visit .append (selection .selection_set )
111+
104112 self ._fragment_spreads [node ] = spreads
105113 return spreads
106114
@@ -133,11 +141,3 @@ def get_directive(self):
133141
134142 def get_argument (self ):
135143 return self ._type_info .get_argument ()
136-
137- @classmethod
138- def gather_spreads (cls , spreads , node ):
139- for selection in node .selections :
140- if isinstance (selection , FragmentSpread ):
141- spreads .append (selection )
142- elif selection .selection_set :
143- cls .gather_spreads (spreads , selection .selection_set )
You can’t perform that action at this time.
0 commit comments