How dynamic can you build the query? By using the @export directive you can force the queries to run sequentially. I'm not sure where to stick the extra eanItemNos though. mutation CreateProductWithGroup($cid: Int!, $cat: Int, $productNo: String) {
useCompany(no: $cid) {
productCategory_create(
values: [{description: "demodemo"}]
suggest: {productCategoryNo: true}
) {
items {
productCategoryNo @export(as: "cat")
}
}
product_create(
values: [{productNo: "1234-tes2t", description: "product description", productCategoryNo1: $cat, eanItemNo: "9999999999999"}]
) {
items {
productNo @export(as: "productNo")
}
}
priceAndDiscountMatrix_create(
values: [{productNo: $productNo, salesPrice1InCurrency: 123}, {productNo: $productNo, salesPrice1InCurrency: 99, customerPriceGroup1: 2}]
) {
affectedRows
items {
productNo
salesPrice1InCurrency
customerPriceGroup1
}
}
}
}
... View more