You could take the legal approach, of course. That's pretty easy to do, but you may consider getting a Joan of Arc outfit to go with the "not a team player" sniping and backbiting likely to accompany this route.
You do have some more attractive options, however.
Make an appointment with a senior partner and state what's happened. The only thing that's changed about you is that you're pregnant, so you need to point out that you're assuming this is the issue.
You can make your case this way:
"There is a very strong business reason my treatment doesn't make sense. I've been with the firm for five years. That's five years of skills, abilities, and knowledge of our firm. I have a proven track record and have created strong loyal relationships with clients.
"In addition to that, I have some time before I go on leave. In those months, it makes sense for me to be as productive as possible. I'm committed to a plan for how my clients will be covered while I'm on leave. It seems like you're stopping utilization of a high performer. You aren't getting the benefits of me in advance of a planned leave. This loss to the firm doesn't make sense."
This does happen often. Companies don't think to "make hay while the sun shines," and wind up underusing their best people well in advance of a known leave. Although senior managers say they're really going to miss key employees who go on vacation or parental leave, it's odd how frequently they act in ways that essentially start that leave early.
In talking to your superiors, you need to ask if they hold assumptions about what you can or cannot handle. Request that if they have questions about your performance or ability, they should ask you instead of making assumptions.
If you are a manager, consider your own assumptions when an employee plans a leave for any reason and don't be afraid to use their skills and abilities right up to their time off.