I am 27 weeks pregnant and I have gestational diabetes and I was wondering if stress can cause the blood sugar to rise?

Yes. Stress and diet both cause sugar levels to be high. With gestational diabetes you will need to eat better, eat low glycemic, exercise and learn how to manage your stress to prevent complications in your pregnancy. Consider therapy if you are stressed. Your emotional framework in pregnancy has been shown to influence children's emotional framework so being calm is so important right now.
Yes. Stress is a common reason for rises in blood sugars for patients with diabetes whether pregnant or not. The body of a pregnant woman is under more stress making her more susceptible to high blood sugars if she's at risk for gestational diabetes.
Yes. Stress causes the adrenal glands to produce cortisol, which elevates blood sugar. Many people with diabetes don't notice much fluctuation in their blood sugar with varying levels of stress, but some do. Stress management is important for all of us, but even more so for diabetics and for pregnant women (and for pregnant women with diabetes).