Class: GraphQL::Client::RenameNodeVisitor

Inherits:
Language::Visitor
  • Object
show all
Defined in:
lib/graphql/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(document, definitions:) ⇒ RenameNodeVisitor

Returns a new instance of RenameNodeVisitor.



243
244
245
246
# File 'lib/graphql/client.rb', line 243

def initialize(document, definitions:)
  super(document)
  @definitions = definitions
end

Instance Method Details

#on_fragment_definition(node, _parent) ⇒ Object



248
249
250
251
# File 'lib/graphql/client.rb', line 248

def on_fragment_definition(node, _parent)
  rename_node(node)
  super
end

#on_fragment_spread(node, _parent) ⇒ Object



258
259
260
261
# File 'lib/graphql/client.rb', line 258

def on_fragment_spread(node, _parent)
  rename_node(node)
  super
end

#on_operation_definition(node, _parent) ⇒ Object



253
254
255
256
# File 'lib/graphql/client.rb', line 253

def on_operation_definition(node, _parent)
  rename_node(node)
  super
end