The username
field was removed in version 2.0 of the graph API. I'm not aware of any workaround (short of using version 1.0).
This change is listed in the "Removed Endpoints" section of the upgrade guide. You can also see that the "User" reference contains no mention of a username
field for version 2.0, but does for version 1.0.
Not all fields are available through the API. You can see exactly what fields are available using the references I've provided above.