File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -988,9 +988,7 @@ def trace_options
988
988
end
989
989
990
990
def new_trace ( **options )
991
- if defined? ( @trace_options )
992
- options = trace_options . merge ( options )
993
- end
991
+ options = trace_options . merge ( options )
994
992
trace_mode = if ( target = options [ :query ] || options [ :multiplex ] ) && target . context [ :backtrace ]
995
993
:default_backtrace
996
994
else
Original file line number Diff line number Diff line change @@ -359,6 +359,20 @@ module NewTrace2
359
359
assert_kind_of NewTrace2 , child_trace
360
360
assert_kind_of GraphQL ::Tracing ::Trace , child_trace
361
361
end
362
+
363
+ it "returns an instance of the parent configured trace_class with trace_options" do
364
+ parent_schema = Class . new ( GraphQL ::Schema ) do
365
+ trace_with NewTrace1 , a : 1
366
+ end
367
+
368
+ child_schema = Class . new ( parent_schema ) do
369
+ end
370
+
371
+ child_trace = child_schema . new_trace
372
+ assert_equal ( { a : 1 } , child_trace . trace_opts )
373
+ assert_kind_of NewTrace1 , child_trace
374
+ assert_kind_of GraphQL ::Tracing ::Trace , child_trace
375
+ end
362
376
end
363
377
364
378
describe ".possible_types" do
You can’t perform that action at this time.
0 commit comments