Fast modulation and switching of light at visible and near-infrared (vis-NIR) frequencies is of utmost importance for optical signal processing and sensing technologies. No fundamental limit appears to prevent us from designing wavelength-sized devices capable of controlling the light phase and intensity at gigaherts (and even terahertz) speeds in those spectral ranges. However, this problem remains largely unsolved, despite recent advances in the use of quantum wells and phase-change materials for that purpose. Here, we explore an alternative solution based upon the remarkable electro-optical properties of graphene. In particular, we predict unity-order changes in the transmission and absorption of vis-NIR light produced upon electrical doping of graphene sheets coupled to realistically engineered optical cavities. The light intensity is enhanced at the graphene plane, and so is its absorption, which can be switched and modulated via Pauli blocking through varying the level of doping. Specifically, we explore dielectric planar cavities operating under either tunneling or Fabry-Perot resonant transmission conditions, as well as Mie modes in silicon nanospheres and lattice resonances in metal particle arrays. Our simulations reveal absolute variations in transmission exceeding 90% as well as an extinction ratio >15 dB with small insertion losses using feasible material parameters, thus supporting the application of graphene in fast electro-optics at vis-NIR frequencies.