Water Resistant is not Water Proof.
Apple Warns against submerging the iPhone. It is not covered by warranty. It should not be done.
Link-> About splash, water, and dust resistance of iPhone 7 and later - Apple Support
To prevent liquid damage, avoid these:
- Swimming or bathing with your iPhone
- Exposing your iPhone to pressurized water or high velocity water, such as when showering, water skiing, wake boarding, surfing, jet skiing, and so on
- Using your iPhone in a sauna or steam room
- Intentionally submerging your iPhone in water
- Operating your iPhone outside the suggested temperature ranges or in extremely humid conditions
- Dropping your iPhone or subjecting it to other impacts
- Disassembling your iPhone, including removing screws
You have voided your warranty, and Apple will not cover it. You will have to pay for a replacement.