  We perform systematic first-principles calculations of the proximity exchange
coupling, induced by cobalt (Co) and nickel (Ni) in graphene, via a few (up to
three) layers of hexagonal boron nitride (hBN). We find that the induced spin
splitting of the graphene bands is of the order of 10 meV for a monolayer of
hBN, decreasing in magnitude but alternating in sign by adding each new
insulating layer. We find that the proximity exchange can be giant if there is
a resonant $d$ level of the transition metal close to the Dirac point. Our
calculations suggest that this effect could be present in Co heterostructures,
in which a $d$ level strongly hybridizes with the valence-band orbitals of
graphene. Since this hybridization is spin dependent, the proximity spin
splitting is unusually large, about 10 meV even for two layers of hBN. An
external electric field can change the offset of the graphene and
transition-metal orbitals and can lead to a reversal of the sign of the
exchange parameter. This we predict to happen for the case of two monolayers of
hBN, enabling electrical control of proximity spin polarization (but also spin
injection) in graphene/hBN/Co structures. Nickel-based heterostructures show
weaker proximity effects than cobalt heterostructures. We introduce two
phenomenological models to describe the first-principles data. The minimal
model comprises the graphene (effective) $p_z$ orbitals and can be used to
study transport in graphene with proximity exchange, while the $p_z$-$d$ model
also includes hybridization with $d$ orbitals, which is important to capture
the giant proximity exchange. Crucial to both models is the
pseudospin-dependent exchange coupling, needed to describe the different spin
splittings of the valence and conduction bands.
