code: def reducer(cls, map, type):
      if not type:
          return map
  
      if isinstance(type, GraphQLList) or isinstance(
          type, GraphQLNonNull
      ):
          return cls.reducer(map, type.of_type)
  
      if type.name in map:
          assert map[type.name] == type, (
              'Schema must contain unique named types but contains multiple types named "{}".'
          ).format(type.name)
  
          return map
  
      map[type.name] = type
  
      reduced_map = map
  
      if isinstance(type, (GraphQLUnionType)):
          for t in type.types:
              reduced_map = cls.reducer(reduced_map, t)
  
      if isinstance(type, GraphQLObjectType):
          for t in type.interfaces:
              reduced_map = cls.reducer(reduced_map, t)
  
      if isinstance(
          type,
          (
              GraphQLObjectType,
              GraphQLInterfaceType,
              GraphQLInputObjectType,
          ),
      ):
          field_map = type.fields
          type_is_input = isinstance(type, GraphQLInputObjectType)
          for field_name, field in field_map.items():
              if type_is_input:
                  assert isinstance(
                      field, GraphQLInputObjectField
                  ), "{}.{} must be an instance of GraphQLInputObjectField.".format(
                      type, field_name
                  )
                  assert is_input_type(
                      field.type
                  ), "{}.{} field type must be Input Type but got: {}.".format(
                      type, field_name, field.type
                  )
              else:
                  assert isinstance(
                      field, (GraphQLField, GraphQLField)
                  ), "{}.{} must be an instance of GraphQLField.".format(
                      type, field_name
                  )
                  assert is_output_type(
                      field.type
                  ), "{}.{} field type must be Output Type but got: {}.".format(
                      type, field_name, field.type
                  )
                  for arg_name, arg in field.args.items():
                      assert isinstance(
                          arg, (GraphQLArgument, GraphQLArgument)
                      ), "{}.{}({}:) argument must be an instance of GraphQLArgument.".format(
                          type, field_name, arg_name
                      )
                      assert is_input_type(
                          arg.type
                      ), "{}.{}({}:) argument type must be Input Type but got: {}.".format(
                          type, field_name, arg_name, arg.type
                      )
                      reduced_map = cls.reducer(reduced_map, arg.type)
  
              reduced_map = cls.reducer(
                  reduced_map, getattr(field, "type", None)
              )
  
      return reduced_map
  
file_path: wandb/wandb/vendor/graphql-core-1.1/wandb_graphql/type/typemap.py
imports: from collections import OrderedDict, defaultdict
  from collections.abc import Sequence
  from functools import reduce
  from ..utils.type_comparators import is_equal_type, is_type_sub_type_of
  from .definition import GraphQLArgument, GraphQLField, GraphQLInputObjectField, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLList, GraphQLNonNull, GraphQLObjectType, GraphQLUnionType, is_input_type, is_output_type
label_desc: Use image node_id 4 for calling the GraphQLTypeMap obj's underlying member method code with example usage: obj.reducer(cls, map, type) and returns: reduced_map, map, cls, map