They’re made up of lots and lots of tiny peepholes, all stuck together like a big puzzle.
From outside

CC BY 2.0 · gailhampshire · Wikimedia Commons · licence
From inside
A scanning electron micrograph of a dragonfly’s compound eye seen from within — the ommatidial channels.

CC BY-SA 4.0 · Brandon Antonio Segura Torres & Priscilla Vieto Bonilla · Wikimedia Commons · licence