They invited me to dinner.

Literal

They [topic-は] me [object-を] meal [to-に] invited [for me-てくれた].

食事に招く means 'to invite to a meal.' ~てくれた frames the invitation as a favor received.