I was about 20 weeks when I had a bad round of gastro. My doc said that as long as dehydration doesn't set in, everything should be fine. His advice was that if I couldn't keep down enough liquids to ensure light-colored pee, to head to the hospital for an IV. I stuck to a very bland diet for a few days (after not keeping down any solids for ~24 hours) as I was able to re-introduce solids - I figured at that point, any solids/nourishment were better than worrying about maximizing nutrition. Good luck!
I had either food poisoning or the stomach flu when I was about 25 weeks. It didn't have any effect on the baby (though how it couldn't I was surprised since I threw up all night long even when nothing was in there) it was a horrible experience but baby was fine.