import actionPromise from "./action-promise";
import {gql} from '../../graphQl/getGQL'
import jwtDecode from '../../helpers/jwt-decode'

/* export const actionAboutMe = () => {
    let _id = jwtDecode(localStorage.authToken).sub.id
    return (
        actionPromise('userData', gql(`
            query($userId: String!) {
                UserFindOne(query: $userId){
                    login, _id, avatar {_id, url, originalFileName}
                }
            }
        `, { userId: JSON.stringify([{ _id }]) }))
    )
} */

/* export const actionChats = () => {
    let _id = jwtDecode(localStorage.authToken).sub.id
    return (
        actionPromise('chats', gql(`
            query($userId: String!) {
                UserFindOne(query: $userId){
                    login, _id, avatar {_id, url, originalFileName}
                }
            }
        `, { userId: JSON.stringify([{ _id }]) }))
    )
} */