A prominent member of a German far-left party has been hit in the face with a chocolate pie, in protest over her stance on refugees.