""" User Mutations """

from graphene import Mutation

from src.models.user import User
from src.serializers import UserGrapheneInputModel, UserGrapheneModel


class CreateUser(Mutation):
    """Mutation for Creating a User"""

    class Arguments:
        """Endpoint Arguments for Mutation"""

        user_details = UserGrapheneInputModel()

    Output = UserGrapheneModel

    @staticmethod
    def mutate(parent, info, user_details):
        """Mutation Function that is called when endpoint is accessed"""

        user = User()
        user.name = user_details.name
        user.address = user_details.address
        user.phone_number = user_details.phone_number
        user.sex = user_details.sex

        user.save()

        return user

ba59cbfb103a8b9c4e597594cf0159528ab1e89a
<mask token>


class CreateUser(Mutation):
    <mask token>


    class Arguments:
        """Endpoint Arguments for Mutation"""
        user_details = UserGrapheneInputModel()
    <mask token>

    @staticmethod
    def mutate(parent, info, user_details):
        """Mutation Function that is called when endpoint is accessed"""
        user = User()
        user.name = user_details.name
        user.address = user_details.address
        user.phone_number = user_details.phone_number
        user.sex = user_details.sex
        user.save()
        return user

<mask token>


class CreateUser(Mutation):
    <mask token>


    class Arguments:
        """Endpoint Arguments for Mutation"""
        user_details = UserGrapheneInputModel()
    Output = UserGrapheneModel

    @staticmethod
    def mutate(parent, info, user_details):
        """Mutation Function that is called when endpoint is accessed"""
        user = User()
        user.name = user_details.name
        user.address = user_details.address
        user.phone_number = user_details.phone_number
        user.sex = user_details.sex
        user.save()
        return user

<mask token>


class CreateUser(Mutation):
    """Mutation for Creating a User"""


    class Arguments:
        """Endpoint Arguments for Mutation"""
        user_details = UserGrapheneInputModel()
    Output = UserGrapheneModel

    @staticmethod
    def mutate(parent, info, user_details):
        """Mutation Function that is called when endpoint is accessed"""
        user = User()
        user.name = user_details.name
        user.address = user_details.address
        user.phone_number = user_details.phone_number
        user.sex = user_details.sex
        user.save()
        return user

<mask token>
from graphene import Mutation
from src.models.user import User
from src.serializers import UserGrapheneInputModel, UserGrapheneModel


class CreateUser(Mutation):
    """Mutation for Creating a User"""


    class Arguments:
        """Endpoint Arguments for Mutation"""
        user_details = UserGrapheneInputModel()
    Output = UserGrapheneModel

    @staticmethod
    def mutate(parent, info, user_details):
        """Mutation Function that is called when endpoint is accessed"""
        user = User()
        user.name = user_details.name
        user.address = user_details.address
        user.phone_number = user_details.phone_number
        user.sex = user_details.sex
        user.save()
        return user

""" User Mutations """

from graphene import Mutation

from src.models.user import User
from src.serializers import UserGrapheneInputModel, UserGrapheneModel


class CreateUser(Mutation):
    """Mutation for Creating a User"""

    class Arguments:
        """Endpoint Arguments for Mutation"""

        user_details = UserGrapheneInputModel()

    Output = UserGrapheneModel

    @staticmethod
    def mutate(parent, info, user_details):
        """Mutation Function that is called when endpoint is accessed"""

        user = User()
        user.name = user_details.name
        user.address = user_details.address
        user.phone_number = user_details.phone_number
        user.sex = user_details.sex

        user.save()

        return user
