Achieving water resistance in a smartphone that folds is quite a task. Samsung achieved an IPX8 rating on its latest foldable devices, i.e., the Z Flip 3.
Although, it has a hinge, the Z Flip 3 can survive for almost half an hour in 5 feet of water without encountering any sort of hardware problems.
These, of course, are the claims by Samsung themselves. However, users who have tested the device rigorously claim that the Z Flip 3 can surpass these limitations as well.
Samsung achieved this great feat by sealing off the components of the phone with water resistant coating while the hinge has a lubricant and an anticorrosive solution to save it from rust.
In a nutshell, you need not worry if fate decides that your Z Flip 3 should go on an accidental swim.