I think that's a Glock 19. It's supposed to be a compact gun, but it's a little too big here, maybe just a small artistic error.
The interesting thing here is, shooting a Glock gun underwater is technically possible, but not advisable due to the risks involved; one of these risks being the danger of getting injured due to the shock wave created by the explosion when the primer ignites the gunpowder. Additionally, the pressure from the explosion can damage the firearm itself. Not to mention, most of the energy of the bullet is lost after traveling one, or three meters underwater, greatly reducing its speed and effectiveness. In this short and old YouTube video, you can see a guy shooting his Glock gun underwater, but if you look at the top left of the video, it seems like he has his head out of the water, probably to avoid the aforementioned risk of getting injured with the shock waves.
So yeah, I thought in all this because there's a joke among Genshin players about Kokomi being a fish, but shooting that thing underwater is a bad idea! Although with all her Hydro powers, I don't think she even needs a gun in the first place.