Graph states are a broad family of entangled quantum states, each defined by a graph composed of edges representing the correlations between subsystems. Such states constitute versatile resources for quantum computation and quantum-enhanced measurement. Their generation and engineering require a high level of control over entanglement. Here we report on the generation of continuous-variable graph states of atomic spin ensembles, which form the nodes of the graph. We program the entanglement structure encoded in the graph edges by combining global photon-mediated interactions in an optical cavity with local spin rotations. By tuning the entanglement between two subsystems, we either localize correlations within each subsystem or enable Einstein–Podolsky–Rosen steering—a strong form of entanglement that enables the extraction of precise information from one subsystem through measurements on the other. We further engineer a four-mode square graph state, highlighting the flexibility of our approach. Our method is scalable to larger and more complex graphs, laying groundwork for measurement-based quantum computation and advanced protocols in quantum metrology.