How can I set the user's role upon registration? #7328

I try to use this solution but when i make a mutation I get an error

i dont know what am i doing wrong

i copied the file from “node_modules\strapi-plugin-users-permissions\controllers\Auth.js”

and pasted it here “extensions\users-permissions\controllers\Auth.js”

and edited the declaration of role, but now i have an error while making a mutation in graphql