import {actionPromise, actionAuthLogout, actionAuthLogin, gql} from "./index"


const actionReg = (login, password) =>{
    return async dispatch => {

        await dispatch(actionPromise('registration', gql(
            `mutation reg ($login:String, $password:String){
                UserUpsert(user: {login:$login, password: $password}) {
                  _id, createdAt
                }
              }`,{login, password})
        ))
    }
}
// mutation reg ($login:String, $password:String){
//     UserUpsert(user: {login:$login, password: $password}) {
//       _id, createdAt
//     }
//   }

export default actionReg;