class GraphQL::StaticValidation::VariablesAreUsedAndDefined
def follow_spreads(node, parent_variables, spreads_for_context, fragment_definitions, visited_fragments)
Use those fragments to update {VariableUsage}s in `parent_variables`.
Follow spreads in `node`, looking them up from `spreads_for_context` and finding their match in `fragment_definitions`.
def follow_spreads(node, parent_variables, spreads_for_context, fragment_definitions, visited_fragments) spreads = spreads_for_context[node] - visited_fragments spreads.each do |spread_name| def_node, variables = fragment_definitions.find { |def_node, vars| def_node.name == spread_name } next if !def_node visited_fragments << spread_name variables.each do |name, child_usage| parent_usage = parent_variables[name] if child_usage.used? parent_usage.ast_node = child_usage.ast_node parent_usage.used_by = child_usage.used_by parent_usage.path = child_usage.path end end follow_spreads(def_node, parent_variables, spreads_for_context, fragment_definitions, visited_fragments) end end