The Lucknow bench of the high court had earlier issued a notice to the Attorney General, the country's top law officer, following which Additional Solicitor General Ashok Mehta and UP Advocate General Raghvendra Singh appeared in the court today.
The court asked them to file a counter-affidavit so that the matter could be decided.
A division bench comprising Justices Sudhir Agrawal and Virendra Kumar passed the order on the petition filed by Sanjai Sharma.
The petitioner cited the Constitution to say that a parliamentarian cannot become a minister in the state government.
He demanded that the appointment of Mr Adityanath as chief minister and Mr Maurya as deputy chief minister be set aside and their parliamentary seats declared vacant. While Mr Adityanath is a member of the Lok Sabha from Gorakhpur, Mr Maurya represents Phulpur in the Lower House of Parliament.
The petitioner also challenged the constitutionality of section 3(A) of the Parliament (Prevention of Disqualification) Act.
Since the constitutionality of a central act cannot be tested without hearing the Attorney General, the court issued a notice to him.