App reviews, troubleshooting, and recommendations
Hello Shopify Community,
I am working on creating products using the productCreate and productVariantsBulkCreate mutations in the 2024-07 version of the GraphQL API. However, I am running into an issue where the process doesn't work as expected.
If anyone has faced a similar issue or knows a better way to handle this, I would appreciate your guidance.
Thank you in advance for your help!
In addition to it, here are mutation I am using for 2024-07,
mutation productVariantsBulkCreate($productId: ID!, $variants: [ProductVariantsBulkInput!]!) { productVariantsBulkCreate(productId: $productId, variants: $variants) { userErrors { field message } product { id title options { id name values position } } productVariants { id title selectedOptions { name value } compareAtPrice createdAt inventoryPolicy inventoryQuantity position price barcode taxable updatedAt inventoryItem { id measurement { weight { unit value } } requiresShipping sku tracked } } } }
and
mutation CreateProduct($product: ProductInput!, $media: [CreateMediaInput!]!) { productCreate(media: $media, input: $product) { product { id: legacyResourceId productType status vendor title description metafields(first: 250) { edges { node { id key value type namespace } } } options { id name position values optionValues { id name hasVariants } } media(first: 10) { edges { node { id mediaContentType } } } } userErrors { field message } } }
have you tried productVariantUpdate mutation after product creation? and pass first variant from creation response?
Also check these mutations
inventoryActivate({
})
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024