I had my iPhone X's lightning port cleaned with compressed air that may have allowed a small blob of grease to be blown into the lightning port. I noticed that it was a bit hard to press in the lightning cable and that there was some orange blob that came out of the iPhone X with the lightning cable. I'm now stuck with a shorted 4th pin on the lightning cable and that the iPhone only charges from one side of the cable.
I'm guessing a foreign object was blown into the port before the lightning cable was inserted, shortening pin #4 on the lightning cable.
I might be wrong about this since it appears to be a common problem with lightning cables, but who knows
Is it more likely a faulty iPhone or lightning cable.
Read more: https://iphoneus.org/faq/will-apple-repair-my-iphone-x-under-warranty-4th-pin-on.html