I want to ask that is it permissible to travel ONLY with the intention of visiting the grave of Prophet Muhammad (SAW) or when we go to medina, our primary intention should be to visit the mosque of the Prophet Muhammad (SAW) and in addition we can visit the grave.
In the Name of Allah, the Most Gracious, the Most Merciful.
As-salāmu ‘alaykum wa-rahmatullāhi wa-barakātuh.
Nabī Sallallāhu Alaihi Wa Sallam was sent to this Dunyā as a Mercy to mankind. Through his presence and efforts, Allāh Ta’ālā eradicated and illuminated the darkness that existed in the world.
The reverence and love for Nabī Sallallāhu Alaihi Wa Sallam is a deeply rooted part of a Muslim’s Imān. Because of the uncountable favors of Nabī Sallallāhu Alaihi Wa Sallam upon the Ummah, the Ummah is highly indebted to him.
The demand of love is that the lover remains restless in anticipation of visiting his beloved. True lovers experience such an ecstasy and joy in visiting the blessed grave of Nabī Sallallāhu Alaihi Wa Sallam that is beyond the scope of description.
Unfortunately, many have the misconception that to visit Medīnah with the Niyyah of only visiting the blessed grave of Nabī Sallallāhu Alaihi Wa Sallam is impermissible. Besides the many juridical texts that prove its permissibility, one can logically comprehend its permissibility. When the blessed city of Medīnah and the blessed Masjid of Nabī Sallallāhu Alaihi Wa Sallam gained their sanctity because of the presence of Nabī Sallallāhu Alaihi Wa Sallam, it would be illogical to conclude that the intention of visiting Medīnah Munawwarah and Masjid al-Nabawī is permissible but intending the blessed grave of Nabī Sallallāhu Alaihi Wa Sallam is impermissible.
In conclusion, to visit Medīna Munawwarah with the intention of visiting the blessed grave of Nabī Sallallāhu Alaihi Wa Sallam is undoubtedly permissible. In fact, the experts and Jurists have stated that it is more appropriate to visit Medīnah Munawwarah only with the Niyyah of visiting the blessed grave of Nabī Sallallāhu Alaihi Wa Sallam as this is to display a higher degree of honor and reverence. 
And Allah Ta’āla Knows Best
Abdul Azīm bin Abdur Rahman,
Student Darul Iftaa
Checked and Approved by,
Mufti Ebrahim Desai.
 الأولى في الزيارة تجريد النية لزيارة قبره صلى الله عليه وسلم (حاشية الطحطاوي علي مراقي الفلاح)
فتاوي دار العلوم زكريا, ج 3، ص 478، زمزم