code: def get_suggested_type_names(schema, output_type, field_name):
      """Go through all of the implementations of type, as well as the interfaces
      that they implement. If any of those types include the provided field,
      suggest them, sorted by how often the type is referenced,  starting
      with Interfaces."""
  
      if isinstance(
          output_type, (GraphQLInterfaceType, GraphQLUnionType)
      ):
          suggested_object_types = []
          interface_usage_count = OrderedDict()
          for possible_type in schema.get_possible_types(output_type):
              if not possible_type.fields.get(field_name):
                  return
  
              # This object type defines this field.
              suggested_object_types.append(possible_type.name)
  
              for possible_interface in possible_type.interfaces:
                  if not possible_interface.fields.get(field_name):
                      continue
  
                  # This interface type defines this field.
                  interface_usage_count[possible_interface.name] = (
                      interface_usage_count.get(
                          possible_interface.name, 0
                      )
                      + 1
                  )
  
          # Suggest interface types based on how common they are.
          suggested_interface_types = sorted(
              list(interface_usage_count.keys()),
              key=lambda k: interface_usage_count[k],
              reverse=True,
          )
  
          # Suggest both interface and object types.
          suggested_interface_types.extend(suggested_object_types)
          return suggested_interface_types
  
      # Otherwise, must be an Object type, which does not have possible fields.
      return []
  
file_path: wandb/wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/fields_on_correct_type.py
imports: from collections import Counter
  from ...error import GraphQLError
  from ...pyutils.ordereddict import OrderedDict
  from ...type.definition import GraphQLInterfaceType, GraphQLObjectType, GraphQLUnionType
  from ...utils.quoted_or_list import quoted_or_list
  from ...utils.suggestion_list import suggestion_list
  from .base import ValidationRule
label_desc: Use image node_id 2 for calling a global function with example usage: get_suggested_type_names(schema, output_type, field_name) and returns: list, suggested_interface_types