import actionPromise from "./action-promise"
import {gql} from '../../graphQl/getGQL'

export const actionRegister = (login, password) => async (dispatch) => {
    actionPromise(
        "register",
        gql(
            `mutation register($login: String, $password: String) {
                    UserUpsert(user: {login: $login, password: $password}) {
                    _id
                    login
                    }
                }`,
            { login: login, password: password }
        )
    )
}