class GraphQL::Analysis::QueryComplexity::TypeComplexity

Find the maximum possible complexity among those combinations.
Selections on an object may apply differently depending on what is actually returned by the resolve function.

def initialize

def initialize
  @types = Hash.new { |h, k| h[k] = 0 }
end

def max_possible_complexity

Return the max possible complexity for types in this selection
def max_possible_complexity
  @types.each_value.max || 0
end

def merge(type_defn, complexity)

Later we will see if this is the max complexity among branches.
Store the complexity for the branch on `type_defn`.
def merge(type_defn, complexity)
  @types[type_defn] += complexity
end