I am currently a level 5 fighter going with Eldritch Knight in a campaign. My friend says that when I use a spell like firebolt to attack an enemy, it does not count as an attack and I cannot use my Extra Attack feature from my class.

It was my understanding that when I hit level 7 I would be able to use a cantrip to attack, then get a bonus melee attack for War Magic, and then use my Extra Attack to attack again, doing the same thing. But according to my friend, once I use any spell I cannot use my Extra Attack ability due to it not being an Attack action only using an action to cast the spell. Is he right?