Not to burst your soap-sud bubble, but modern dishwashers use less water than washing by hand[1], and by extension less electricity (purifying water is high-electricity usage, moving it around within your dishwasher is not)
I haven't measured my water usage, but 5 GALLONS for a standard dishwasher, and 3.5 for a compact?
I feel like if I tried, I could use less water than that... I already don't run the tap while washing. I wet my sponge and scrub away. I only use 30-50mL of water at a time if my sponge gets dry, and my main water usage comes from rinsing.
If you tried. It takes active effort to use less than that. The typical sink fills with more than that, and even if you fill it half way, you use more than the rest rinsing.
[1] https://www.npr.org/sections/thesalt/2017/11/24/564055953/to...