code: def do_types_conflict(type1: GraphQLOutputType, type2: GraphQLOutputType) -> bool:
      
      if is_list_type(type1):
          return (
              do_types_conflict(
                  cast(GraphQLList, type1).of_type, cast(GraphQLList, type2).of_type
              )
              if is_list_type(type2)
              else True
          )
      if is_list_type(type2):
          return True
      if is_non_null_type(type1):
          return (
              do_types_conflict(
                  cast(GraphQLNonNull, type1).of_type, cast(GraphQLNonNull, type2).of_type
              )
              if is_non_null_type(type2)
              else True
          )
      if is_non_null_type(type2):
          return True
      if is_leaf_type(type1) or is_leaf_type(type2):
          return type1 is not type2
      return False
docs: Check whether two types conflict
  
      Two types conflict if both types could not apply to a value simultaneously.
      Composite types are ignored as their individual field types will be compared later
      recursively. However List and Non-Null types must match.