2021-03-12 12:14:18 +00:00
|
|
|
export function getProductDetails(productId, channelId) {
|
|
|
|
const query = `fragment BasicProductFields on Product {
|
2021-03-12 14:57:02 +00:00
|
|
|
id
|
|
|
|
name
|
|
|
|
}
|
|
|
|
|
|
|
|
fragment Price on TaxedMoney {
|
|
|
|
gross {
|
|
|
|
amount
|
|
|
|
currency
|
2021-02-23 14:30:52 +00:00
|
|
|
}
|
2021-03-12 14:57:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fragment ProductVariantFields on ProductVariant {
|
|
|
|
id
|
|
|
|
sku
|
|
|
|
name
|
|
|
|
pricing {
|
|
|
|
price {
|
|
|
|
...Price
|
2021-02-25 09:51:52 +00:00
|
|
|
}
|
|
|
|
}
|
2021-03-12 14:57:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
query ProductDetails{
|
|
|
|
product(id: "${productId}", channel: "${channelId}") {
|
|
|
|
...BasicProductFields
|
|
|
|
variants {
|
|
|
|
...ProductVariantFields
|
2021-02-25 09:51:52 +00:00
|
|
|
}
|
2021-03-12 14:57:02 +00:00
|
|
|
isAvailable
|
|
|
|
isAvailableForPurchase
|
|
|
|
availableForPurchase
|
2021-02-25 09:51:52 +00:00
|
|
|
}
|
2021-03-12 14:57:02 +00:00
|
|
|
}`;
|
2021-03-12 12:14:18 +00:00
|
|
|
return cy.sendRequestWithQuery(query, "token");
|
2021-02-23 14:30:52 +00:00
|
|
|
}
|