Module: GraphQL::Schema::ReduceTypes

Defined in:
lib/graphql/schema/reduce_types.rb

Class Method Summary collapse

Class Method Details

.reduce(types) ⇒ GraphQL::Schema::TypeMap

Returns {name => Type} pairs derived from types

Parameters:

  • types (Array<GraphQL::BaseType>)

    members of a schema to crawl for all member types

Returns:


6
7
8
9
10
11
12
# File 'lib/graphql/schema/reduce_types.rb', line 6

def self.reduce(types)
  type_map = GraphQL::Schema::TypeMap.new
  types.each do |type|
    reduce_type(type, type_map, type.name)
  end
  type_map
end