The doctor said I have high sugar and I'm at risk for diabetes. How can it affect my unborn baby?

Many risks. The baby can have macrosomia (large birth weight), increased amniotic fluid, fetal death, neonatal hypoglycemia, jaundice, shoulder dystocia, brachial plexus injury, cesarean section, cardiomyopathy. The mother is also at risk for diabetes after pregnancy, especially if she is overweight, older than 35, physically inactive, hispanic or has a family history of diabetes.
High can. High glucose is diabetes, and can have many bad effects for your child. Your doctor should be checking your glucose tolerance soon, as you are 28 weeks.