A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
I am creating variants for a product using productVariantsBulkCreate:
mutation productVariantsBulkCreate($productId: ID!, $variants: [ProductVariantsBulkInput!]!) { productVariantsBulkCreate(productId: $productId, strategy: REMOVE_STANDALONE_VARIANT, variants: $variants) { userErrors { field message } product { id } productVariants { id title } } }
The input looks something like this:
{ barcode: db_variant.barcode, compareAtPrice: db_variant.compareAtPrice?.toFixed(2) || undefined, inventoryItem: { cost: db_variant.costPerItem, harmonizedSystemCode: db_variant.harmonizedSystemCode || undefined, measurement: measurement, requiresShipping: db_variant.physicalProduct, sku: db_variant.SKU, tracked: db_variant.trackQuantity, }, inventoryPolicy: db_variant.continueSellingWhenOutOfStock ? "CONTINUE" : "DENY", mediaId: found_mediaId || undefined, optionValues: shopify_optionValues, price: db_variant.price.toFixed(2), taxable: db_variant.chargeTaxes, }
I want to set an available quantity of 999 to each variant (in inventoryItem).
I was previously able to set it with the REST API.
Is this possible with GraphQL without the "read_locations" and "read_inventory" scopes?