Without the product ID, I can’t run the productVariantsBulkDelete mutation. It requires the product ID and the variant IDs. The LineItemGroup only has the variant ID
Hi @Benny_Chan you can fetch the parent product from a variant by querying the variant’s product field. For example:
query getProductIdFromVariant($variantId: ID!) {
node(id: $variantId) {
... on ProductVariant {
id
product {
id
}
}
}
}
Once you have the product’s ID, you can include that in the productVariantsBulkDelete
mutation.
Yes, but I think the product ID should be added. If I have to use multiple API calls, it’s not necessary to use graphql. It’s much faster to use the REST admin API to get the product ID from the variant ID. I can use the Shopify Python API with a few lines, but this is prohibited to do so.
IMO, the bundle fields are not fully added to liquid, webhook payloads and the graphql API, which leads to multiple API calls.