[RPG] Would a cantrip like firebolt count as an attack to be able to use Extra Attack?

actionsattackdnd-5efighterspells

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?

Best Answer

Extra Attack states:

Beginning at 5th level, you can attack twice, instead of once, whenever you take the Attack action on your turn.

Casting a spell uses the Cast a Spell action, not the Attack action. Therefore you can't cast a spell as your extra attack.