import {actionPromise, gql} from "./index";




const actionUserFindOne = (user) => {
    //debugger
    return async dispatch => {
        const queryJson = JSON.stringify([{
            "_id": user}]);
        await dispatch(actionPromise(`user`, gql(
            `query userOne ($query: String){
                UserFindOne(query: $query){
                  login
                  _id
                  createdAt
                      avatar {_id url}
                  acl
                  nick
                }
              }`, {query: queryJson}
        )))
    }
}

export default actionUserFindOne;