Right from the beginning of the show, everyone has been consistently behind finding the rightful heir to the iron throne. While there have been a lot of speculations, after six seasons, it was revealed that the rightful heir was Gendry, the blacksmith, who was the bastard son of Robert Baratheon. He was the one who travelled with Arya in the early seasons.