PedroBern / django-graphql-auth

Django registration and authentication with GraphQL.
https://django-graphql-auth.readthedocs.io/en/latest/
MIT License
326 stars 105 forks source link

How to let users update thier own user profiles with token? #158

Open timytomy opened 2 years ago

timytomy commented 2 years ago

I want users to update thier own user profiles so I used "updateAccount" as shown below but, the error "Unauthenticated" occurred even though the account is verified and logged in. :

mutation {
  updateAccount(
    firstName: "John"
  ) {
    success,
    errors
  }
}

So, I added "token" as shown below but the error "Unknown argument \"token\" on field \"updateAccount\" of type \"Mutation\"." occurred:

mutation {
  updateAccount(
    token: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6ImthenlhLml0by5kcmVhbUBnbWFpbC5jb20iLCJleHAiOjE2NTM4NzY0NDgsIm9yaWdJYXQiOjE2NTM4NzYxNDh9.2yyp9k86V_0AoiPJFmxTE6__-q1n4cWNysOw8bNIDqA"
    firstName: "John"
  ) {
    success,
    errors
  }
}

Are there any ways to let users to update thier own user profiles?