Note: The Guadalupe restaurant mentioned in this post is temporarily closed.
You probably want to eat in the area around the entrance to the Alhambra and the car park.
If you wanted to go down into the centre of Granada you would need to catch a bus.
I go to the Alhambra several times a year and I have tried some places.
If you don't mind spending money the Parador has a good restaurant.
More info
https://granadamap.com/parador/indexsp.htmIf the weather is good there is an outside restaurant called the Mimbre.
There is a web page of it here.
https://granadamap.com/mimbre/It's not very cheap.
Another outside place is the Jardines de Alberto.
When you come out of the Alhambra go down the hill about 60 metres.
It's opposite the ticket office.
There is a menu del dia for 14 euros midweek and 19 euros at the weekend.
https://granadamap.com/alberto/For a cheap but good option, the hotel guadalupe has a menu del dia for about 10 euros per person in the hotel dining room. There are never many people and there is a pleasant relaxed atmosphere.
This is the best quality/price ratio
More info
https://granadamap.com/guadalupe/The Yedra Real is another menu del dia place next door to it but I prefer the guadalupe hotel.
More info
https://granadainfo.com/yedra/rest.htm