I'm running the following SOQL query:
SELECT Profile.Name, Title FROM User WHERE Id = '<some id>'
Most of the times it works fine, but for some users I get the following error (I guess it's because the token I'm using doesn't have the permissions for the
No such relation 'Profile' on entity 'User'
Is there a way to craft the query to return
Profile.Name only when
Profile is supported, and to return NULL (or similar) when we have no permissions to