Whether a gradient exists will depend on the type of data and what you're trying to predict.
But we can represent objects in a non-discrete way, with embeddings, hidden state vectors etc. My point is, people are getting around this problem.
Great progress has been made using that, e.g. advancements in NLU. But it is not a complete workaround. Embeddings don't work if your relationship is non differentiable. And you will lose the gradient for very long contexts (deep networks), even using new techniques like attention and transformers.