Many common genetic polymorphisms are associated with glycemic traits and type 2 diabetes (T2D), but knowledge about genetic determinants of glycemic traits in pregnancy is limited. We tested genetic variants known to be associated with glycemic traits and T2D in the general population for associations with glycemic traits in pregnancy and gestational diabetes mellitus (GDM). Participants in two cohorts (Gen3G and HAPO) underwent oral glucose tolerance testing at 24-32 weeks gestation. We built genetic risk scores (GRSs) for elevated fasting glucose and insulin, reduced insulin secretion and sensitivity, and T2D, using variants discovered in studies of non-pregnant individuals; we tested for associations between these GRSs, glycemic traits in pregnancy, and GDM. In both cohorts, the fasting glucose GRS was strongly associated with fasting glucose. The insulin secretion and sensitivity GRSs were also significantly associated with these traits in Gen3G, where insulin measurements were available. The fasting insulin GRS was weakly associated with fasting insulin (Gen3G) or C-peptide (HAPO). In HAPO (207 GDM cases), all five GRSs (T2D, fasting glucose, fasting insulin, insulin secretion, and insulin sensitivity) were significantly associated with GDM. In Gen3G (43 GDM cases), both the T2D and insulin secretion GRSs were associated with GDM; effect sizes for the other GRSs were similar to those in HAPO. Thus, despite the profound changes in glycemic physiology during pregnancy, genetic determinants of fasting glucose, fasting insulin, insulin secretion and insulin sensitivity discovered outside of pregnancy influence GDM risk.