code: def type_check_and_str(python_type, value):
      
      if not isinstance(value, python_type):
          raise GraphQLInvalidArgumentError(u'Attempting to represent a non-{type} as a {type}: '
                                            u'{value}'.format(type=python_type, value=value))
  
      return str(value)
docs: Type-check the value, and then just return str(value).