Authentication
Warning
This solution is enough for web browsers, but will not work for clients that doesnβt have a way to store cookies in it (e.g. mobile apps). For those it is recommended to use token authentication methods. JWT can be used with strawberry-django-auth lib.
 strawberry_django   provides mutations to get authentication going right away.
The auth.register   mutation performs password validation using Djangoβs validate_password   method. 
import strawberry_djangofrom strawberry import autofrom django.contrib.auth import get_user_model
@strawberry_django.type(get_user_model())class User:    username: auto    email: auto
@strawberry_django.input(get_user_model())class UserInput:    username: auto    password: auto  import strawberryimport strawberry_djangofrom .types import User, UserInput
@strawberry.typeclass Query:    me: User = strawberry_django.auth.current_user()
@strawberry.typeclass Mutation:    login: User = strawberry_django.auth.login()    logout = strawberry_django.auth.logout()    register: User = strawberry_django.auth.register(UserInput)