Method: GraphQL::StaticValidation::VariablesAreUsedAndDefined#on_variable_identifier

Defined in:
lib/graphql/static_validation/rules/variables_are_used_and_defined.rb

#on_variable_identifier(node, parent) ⇒ Object

For VariableIdentifiers:

  • mark the variable as used
  • assign its AST node


68
69
70
71
72
73
74
75
76
# File 'lib/graphql/static_validation/rules/variables_are_used_and_defined.rb', line 68

def on_variable_identifier(node, parent)
  usage_context = @variable_context_stack.last
  declared_variables = @variable_usages_for_context[usage_context]
  usage = declared_variables[node.name]
  usage.used_by = usage_context
  usage.ast_node = node
  usage.path = context.path
  super
end