@JoeC is correct.
Also bear in mind that it is possible to change the government without calling an election. If Johnson were to resign as Prime Minister then he would get to nominate a successor. I don't know who he would nominate that could form a government. It would be a chance to nominate a less divisive Tory (e.g. Ken Clarke), but given he's just been kicked out of the party, that seems unlikely.
If the Prime Minister's nominee cannot form a government, the Queen should ask the leader of the next largest party (Jeremy Corbyn) if he could command a majority in the House of Commons. With the appropriate caveats (and probably a promise of elections after No Deal is avoided), he probably can. Whether he is willing to take office under such restrictions remains uncertain.