code: def _safe_match_date_and_datetime(graphql_type, expected_python_types, value):
      
      # Python datetime.datetime is a subclass of datetime.date,
      # but in this case, the two are not interchangeable.
      # Rather than using isinstance, we will therefore check for exact type equality.
      value_type = type(value)
      if not any(value_type == x for x in expected_python_types):
          raise GraphQLInvalidArgumentError(u'Expected value to be exactly one of '
                                            u'python types {}, but was {}: '
                                            u'{}'.format(expected_python_types, value_type, value))
  
      # The serialize() method of GraphQLDate and GraphQLDateTime produces the correct
      # ISO-8601 format that MATCH expects. We then simply represent it as a regular string.
      try:
          serialized_value = graphql_type.serialize(value)
      except ValueError as e:
          raise GraphQLInvalidArgumentError(e)
  
      return _safe_match_string(serialized_value)
docs: Represent date and datetime objects as MATCH strings.