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


const actionGoodCard = (_id) => {
    return async dispatch => {
    const queryJson = JSON.stringify([{
        "_id": `${_id}`
      }]);
    await dispatch(actionPromise(`goodCard`, gql (
        `query oneGood($query: String) {
            GoodFindOne(query: $query) {
                _id
                createdAt
                name
                description
                price
                images{url _id}
            }
          }
    ` ,{ query: queryJson})))
  }
}

  export default actionGoodCard;