Skip to content

Commit 63193d8

Browse files
authored
Merge pull request #5332 from rmosolgo/context-cleanup
Remove some unused context state
2 parents 8fc120d + 9d56140 commit 63193d8

3 files changed

Lines changed: 1 addition & 15 deletions

File tree

lib/graphql/execution/interpreter.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,6 @@ def run_all(schema, query_options, context: {}, max_complexity: schema.max_compl
9393
# Then, work through lazy results in a breadth-first way
9494
multiplex.dataloader.append_job {
9595
query = multiplex.queries.length == 1 ? multiplex.queries[0] : nil
96-
queries = multiplex ? multiplex.queries : [query]
97-
final_values = queries.map do |query|
98-
runtime = query.context.namespace(:interpreter_runtime)[:runtime]
99-
# it might not be present if the query has an error
100-
runtime ? runtime.final_result : nil
101-
end
102-
final_values.compact!
10396
multiplex.current_trace.execute_query_lazy(multiplex: multiplex, query: query) do
10497
Interpreter::Resolve.resolve_each_depth(lazies_at_depth, multiplex.dataloader)
10598
end

lib/graphql/query/context.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ def add(err_or_msg)
3939
# @return [GraphQL::Schema]
4040
attr_reader :schema
4141

42-
# @return [Array<String, Integer>] The current position in the result
43-
attr_reader :path
44-
4542
# Make a new context which delegates key lookup to `values`
4643
# @param query [GraphQL::Query] the query who owns this context
4744
# @param values [Hash] A hash of arbitrary values which will be accessible at query-time
@@ -53,9 +50,6 @@ def initialize(query:, schema: query.schema, values:)
5350
@storage = Hash.new { |h, k| h[k] = {} }
5451
@storage[nil] = @provided_values
5552
@errors = []
56-
@path = []
57-
@value = nil
58-
@context = self # for SharedMethods TODO delete sharedmethods
5953
@scoped_context = ScopedContext.new(self)
6054
end
6155

@@ -245,7 +239,7 @@ def logger
245239
end
246240

247241
def inspect
248-
"#<Query::Context ...>"
242+
"#<#{self.class} ...>"
249243
end
250244

251245
def scoped_merge!(hash)

spec/spec_helper.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ def traces
177177

178178
def trace(key, data)
179179
data[:key] = key
180-
data[:path] ||= data.key?(:context) ? data[:context].path : nil
181180
result = yield
182181
data[:result] = result
183182
traces << data

0 commit comments

Comments
 (0)