@@ -165,74 +165,6 @@ def execute(ast_operation, root_type, query_object)
165165 initial_result
166166 end
167167
168- # Global, immutable environment for executing `query`.
169- # Passed through all execution to provide type, fragment and field lookup.
170- class ExecScope
171- attr_reader :query , :schema
172-
173- def initialize ( query )
174- @query = query
175- @schema = query . schema
176- end
177-
178- def get_type ( type )
179- @schema . types [ type ]
180- end
181-
182- def get_fragment ( name )
183- @query . fragments [ name ]
184- end
185-
186- # This includes dynamic fields like __typename
187- def get_field ( type , name )
188- @schema . get_field ( type , name ) || raise ( "No field named '#{ name } ' found for #{ type } " )
189- end
190- end
191-
192- # One serial stream of execution. One thread runs the initial query,
193- # then any deferred frames are restarted with their own threads.
194- #
195- # - {ExecThread#errors} contains errors during this part of the query
196- # - {ExecThread#defers} contains {ExecFrame}s which were marked as `@defer`
197- # and will be executed with their own threads later.
198- class ExecThread
199- attr_reader :errors , :defers
200- def initialize
201- @errors = [ ]
202- @defers = [ ]
203- end
204- end
205-
206- # One step of execution. Each step in execution gets its own frame.
207- #
208- # - {ExecFrame#node} is the IRep node which is being interpreted
209- # - {ExecFrame#path} is like a stack trace, it is used for patching deferred values
210- # - {ExecFrame#value} is the object being exposed by GraphQL at this point
211- # - {ExecFrame#type} is the GraphQL type which exposes {#value} at this point
212- class ExecFrame
213- attr_reader :node , :path , :type , :value
214- def initialize ( node :, path :, type :, value :)
215- @node = node
216- @path = path
217- @type = type
218- @value = value
219- end
220- end
221-
222- # Contains the list field's ExecFrame
223- # And the enumerator which is being mapped
224- # - {ExecStream#enumerator} is an Enumerator which yields `item, idx`
225- # - {ExecStream#frame} is the {ExecFrame} for the list selection (where `@stream` was present)
226- # - {ExecStream#type} is the inner type of the list (the item's type)
227- class ExecStream
228- attr_reader :enumerator , :frame , :type
229- def initialize ( enumerator :, frame :, type :)
230- @enumerator = enumerator
231- @frame = frame
232- @type = type
233- end
234- end
235-
236168 private
237169
238170 # If this `frame` is marked as defer, add it to `defers`
0 commit comments