It really depends on what the problem is. Apple generally simplifies repair prices into battery replacement, screen/display replacement, and everything else (aka "other repair"). But what "other repair" usually means is a complete replacement (with a refurbished or new device with a special model number) since they typically don't have anyone at an Apple Store trained to do anything more complicated than a battery or screen replacement service. Here's the US price listing for "other repair". That would require exchange of the damaged device, which might be sent in for repair at one of Apple's central repair facilities or perhaps their contract manufacturer to be refurbished.
iPhone Repair - Official Apple Support
That being said, I have personally had service at an Apple Store where I specifically got a repair done for free as a courtesy where there were no parts or whatever repair parts needed were minimal. One time was a broken key on my MacBook Pro, even though that required a new part (just the broken key replaced). Another time my wife mistakenly jammed her SIM card in the slot without the tray and we waited about an hour without an appointment where they then took about a half hour before it was extracted for free. If just the cable is dislodged and it only takes a simple reconnection, that's something that could be done for free as a courtesy. But at the very least I think you can make an appointment at an Apple Store and not worry about getting charged without your consent. If you don't have access to an Apple Store, that makes things more difficult as and authorized service provider might require a fee just to look at what the problem might be. I've never been charged for a diagnostic at an Apple Store.