# User Mutations

These are the mutations defined under the user model, there are used to fetch data from the api regarding users

# signIn

    signIn(email: String!, password: String!) : Token
1

mutation for signing a user in and getting a token. email - can also be a username

# signUp

    signUp(new_user: IUser) : Token
1

mutation for signing a user up

# sendVerification

    sendVerification: Boolean
1

mutation for sending an email-verification email to the user's email address

# resetPassword

    resetPassword(email: String): Boolean
1

mutation for sending a password reset token to the user's email address

# resetPasswordWithToken

    resetPasswordWithToken(token: String, newPassword: String): Boolean
1

mutation for modifying a password for a user given that the given reset token is correct

# makeUserAdmin

    makeUserAdmin(uid: Int) : Boolean
1

mutation for increasing the role field of a user to level 4. Which is an admin.

# signOut

    signOut: Boolean
1

mutation for signing the user out. It's not required for normal api use but for a frontend this helps by clearing the cookies associated with user identification.

# Graphql Schema

gql schema for this model goes

extend type Mutation {
    signIn(email: String!, password: String!) : Token
    signUp(new_user: IUser) : Token
    sendVerification: Boolean
    resetPassword(email: String): Boolean
    resetPasswordWithToken(token: String, newPassword: String): Boolean
    makeUserAdmin(uid: Int) : Boolean
    signOut: Boolean
}
1
2
3
4
5
6
7
8
9