BeSha'ah tovah!
A woman who is pregnant should take care to drink a lot of fluids for a few days prior to the fast to prevent dehydration. Spending the day in bed, and maintaining the fast, is preferable to attending shul and winding up breaking it. However, situations are individual. Depending on the circumstances, it may be either required, permitted, or prohibited for you to fast. If you feel more ill than anticipated during the fast, you should consult with a rabbi about whether you should eat normally, eat or drink in shiurim (small, measured quantities), or fast.
There is some range of opinion about exactly when shiurim should be eaten. It would be best to speak ahead of time with a local rabbi who will be available for consultation during the fast. That way, you can have his general parameters ahead of time, but can also double check with him if need be. If there is a specific medical reason for you not to fast, that should be brought to his attention beforehand.
If you do not have a local rabbi and would like a more detailed ruling from our site's rabbinical supervisor, Rav Yehuda Henkin, please write back, being sure to include any other relevant details.