import apollo from "../../lib/apollo.js";

async function GetCheckoutproduct(id, token = "") {
    var res = await apollo.query(
        `
        query($input: ID!){
        products(where:{id:$input})
        {
            name
            price
            description
            img{
            url
            }
            overview
            specification
            film
            stock
        }
        }	`,
        token, {
        "input": id
        }
    );
    return res;
}

async function GetCheckoutproductBayar(id, token = "") {
    var res = await apollo.query(
        `
        query($input: ID!) {
            product(id:$input) {
                id
                name
                price
                description
                img {
                    url
                }
                overview
                specification
                film
                stock
            }
        }
        `,
        token, {
        "input": id
        }
    );
    return res;
}

module.exports = {
    GetCheckoutproduct: GetCheckoutproduct,
    GetCheckoutproductBayar: GetCheckoutproductBayar,
};