Depending on all of the facts, you may have a claim against your employer for pregnancy discrimination, which violates Title VII of the Civil Rights Act of 1964, as amended by the Pregnancy Discrimination Act. You should contact an attorney immediately to discuss your options.
Please feel free to call my office. I would be happy to assist you.
My response to this question is a response to a hypothetical situation based on limited facts. I am not your attorney; you are not my client and we do not have an attorney-client relationship. If you need a lawyer, you should contact one in your area. If you would like to talk with me about your case, you can call my office.
As Mr. Pollard said, it may be possible, but you need to see an attorney right away, and bring all the facts (including what this task was). The PDA is a possibility, but just based on what you've said here I don't think it's a winning case because it appears that you were fired for a reason other than your pregnancy, and given that your boss was fired also, it looks like the company would be able to say that there was a just reason to fire you.