@@ -77,18 +77,18 @@ def rename_query(
77
77
78
78
79
79
class RenameQueryVisitor (Visitor ):
80
- def __init__ (self , renamings : Dict [str , str ]) -> None :
80
+ def __init__ (self , type_renamings : Dict [str , str ]) -> None :
81
81
"""Create a visitor for renaming types and root vertex fields in a query AST.
82
82
83
83
Args:
84
- renamings : Maps type or root field names to the new value in the dict.
85
- Any name not in the dict will be unchanged
84
+ type_renamings : Maps type or root field names to the new value in the dict.
85
+ Any name not in the dict will be unchanged
86
86
"""
87
- self .renamings = renamings
87
+ self .type_renamings = type_renamings
88
88
self .selection_set_level = 0
89
89
90
90
def _rename_name (self , node : RenameQueryNodeTypesT ) -> RenameQueryNodeTypesT :
91
- """Change the name of the input node if necessary, according to renamings .
91
+ """Change the name of the input node if necessary, according to type_renamings .
92
92
93
93
Args:
94
94
node: represents a field in an AST, containing a .name attribute. It is not modified
@@ -98,7 +98,7 @@ def _rename_name(self, node: RenameQueryNodeTypesT) -> RenameQueryNodeTypesT:
98
98
the name was not changed, the returned object is the exact same object as the input
99
99
"""
100
100
name_string = node .name .value
101
- new_name_string = self .renamings .get (name_string , name_string ) # Default use original
101
+ new_name_string = self .type_renamings .get (name_string , name_string ) # Default use original
102
102
if new_name_string == name_string :
103
103
return node
104
104
else :
0 commit comments