Skip to content

Commit 049bb67

Browse files
committed
Remove Visitor#response_path_str
1 parent 8d0b3ed commit 049bb67

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

lib/graphql/analysis/ast/query_complexity.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def on_leave_field(node, parent, visitor)
4040
own_complexity = get_complexity(node, visitor.field_definition, child_complexity, visitor)
4141

4242
if @complexities_on_type.last.is_a?(AbstractTypeComplexity)
43-
key = selection_key(visitor.response_path_str, visitor.query)
43+
key = selection_key(visitor.response_path, visitor.query)
4444
parent_type = visitor.parent_type_definition
4545
query.possible_types(parent_type).each do |type|
4646
@complexities_on_type.last.merge(type, key, own_complexity)
@@ -69,7 +69,7 @@ def selection_key(response_path, query)
6969
# We add the query object id to support multiplex queries
7070
# even if they have the same response path, they should
7171
# always be added.
72-
"#{response_path}-#{query.object_id}"
72+
"#{response_path.join(".")}-#{query.object_id}"
7373
end
7474

7575
# Get a complexity value for a field,

lib/graphql/analysis/ast/visitor.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ def response_path
6060
@response_path.dup
6161
end
6262

63-
# @return String The a stringified path to the response key for the current field
64-
def response_path_str(separator = '.')
65-
@response_path.join(separator)
66-
end
67-
6863
# Visitor Hooks
6964

7065
def on_operation_definition(node, parent)

0 commit comments

Comments
 (0)