Optical frequency combs, which emit pulses of light at discrete, equally spaced frequencies, are cornerstones of modern-day frequency metrology, precision spectroscopy, astronomical observations, ultrafast optics and quantum information. Chip-scale frequency combs, based on the Kerr and Raman nonlinearities in monolithic microresonators with ultrahigh quality factors, have recently led to progress in optical clockwork and observations of temporal cavity solitons. But the chromatic dispersion within a laser cavity, which determines the comb formation, is usually difficult to tune with an electric field, whether in microcavities or fibre cavities. Such electrically dynamic control could bridge optical frequency combs and optoelectronics, enabling diverse comb outputs in one resonator with fast and convenient tunability. Arising from its exceptional Fermi-Dirac tunability and ultrafast carrier mobility, graphene has a complex optical dispersion determined by its optical conductivity, which can be tuned through a gate voltage. This has brought about optoelectronic advances such as modulators, photodetectors and controllable plasmonics. Here we demonstrate the gated intracavity tunability of graphene-based optical frequency combs, by coupling the gate-tunable optical conductivity to a silicon nitride photonic microresonator, thus modulating its second- and higher-order chromatic dispersions by altering the Fermi level. Preserving cavity quality factors up to 10 in the graphene-based comb, we implement a dual-layer ion-gel-gated transistor to tune the Fermi level of graphene across the range 0.45-0.65 electronvolts, under single-volt-level control. We use this to produce charge-tunable primary comb lines from 2.3 terahertz to 7.2 terahertz, coherent Kerr frequency combs, controllable Cherenkov radiation and controllable soliton states, all in a single microcavity. We further demonstrate voltage-tunable transitions from periodic soliton crystals to crystals with defects, mapped by our ultrafast second-harmonic optical autocorrelation. This heterogeneous graphene microcavity, which combines single-atomic-layer nanoscience and ultrafast optoelectronics, will help to improve our understanding of dynamical frequency combs and ultrafast optics.