Hi Rabiya,
Did you provided full consent to the GraphAPI for the user's properties? Just check under the preview tab and provide the permissions if required.
Also check the permissions over here required for using GraphAPI.
auth-concepts
==
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.