import { actionPromise } from '.';
import gql from '../api';

const actionCatById = (_id) =>
  actionPromise('catById', gql(`query catById($q: String){
      CategoryFindOne(query:$q){
         _id name subCategories {
          _id
          name 
          goods {
            _id name description price images{
            url _id
            }
          }
       }goods {
         _id name price description images{
           url _id
         }
       }
     }
   }`, { q: JSON.stringify([{ _id }]) }));

export default actionCatById;
