  Entanglement has evolved from an enigmatic concept of quantum physics to a
key ingredient of quantum technology. It explains correlations between
measurement outcomes that contradict classical physics, and has been widely
explored with small sets of individual qubits. Multi-partite entangled states
build up in gate-based quantum-computing protocols, and $\unicode{x2013}$ from
a broader perspective $\unicode{x2013}$ were proposed as the main resource for
measurement-based quantum-information processing. The latter requires the
ex-ante generation of a multi-qubit entangled state described by a graph. Small
graph states such as Bell or linear cluster states have been produced with
photons, but the proposed quantum computing and quantum networking applications
require fusion of such states into larger and more powerful states in a
programmable fashion. Here we achieve this goal by employing an optical
resonator containing two individually addressable atoms. Ring and tree graph
states with up to eight qubits, with the names reflecting the entanglement
topology, are efficiently fused from the photonic states emitted by the
individual atoms. The fusion process itself employs a cavity-assisted gate
between the two atoms. Our technique is in principle scalable to even larger
numbers of qubits, and is the decisive step towards, for instance, a
memory-less quantum repeater in a future quantum internet.
