Method: GraphQL::Analysis::QueryComplexity::ScopedTypeComplexity#initialize

Defined in:
lib/graphql/analysis/query_complexity.rb

#initialize(parent_type, field_definition, query, response_path) ⇒ Hash<GraphQL::BaseType, Hash<String, ScopedTypeComplexity>>

Parameters:

  • parent_type (Class)

    The owner of field_definition

  • field_definition (GraphQL::Field, GraphQL::Schema::Field)

    Used for getting the .complexity configuration

  • query (GraphQL::Query)

    Used for query.possible_types

  • response_path (Array<String>)

    The path to the response key for the field



57
58
59
60
61
62
63
64
# File 'lib/graphql/analysis/query_complexity.rb', line 57

def initialize(parent_type, field_definition, query, response_path)
  super(&DEFAULT_PROC)
  @parent_type = parent_type
  @field_definition = field_definition
  @query = query
  @response_path = response_path
  @nodes = []
end