Ripe, cooked eggplant flesh is safe in small amounts, but eggplant is a nightshade — the leaves and stems contain toxic solanine, so only the cooked fruit, never the green parts.
Eggplant is a nightshade like tomato and potato. The ripe fruit's flesh contains only trace solanine and is safe cooked in moderation, but the leaves, stems, and any green/unripe parts carry enough solanine to be toxic. Cooking also improves digestibility.