Skip to main content

ProductBulkCreate

Result of product bulk create mutation.

type ProductBulkCreate {
count: Int!
products: [Product!]!
bulkProductErrors: [BulkProductError!]!
bulkProductWarnings: [BulkProductWarning!]!
}

Fields​

ProductBulkCreate.count ● Int! non-null scalar​

Returns how many objects were created or updated.

ProductBulkCreate.products ● [Product!]! non-null object​

List of the created or updated products.

ProductBulkCreate.bulkProductErrors ● [BulkProductError!]! non-null object​

List of errors that occurred executing the mutation. An entry's index identifies the input row it came from. Note that an entry with field: "image" does NOT mean the row failed: that product was created and only its rejected image was dropped, so treating every index in this list as a failed row would mark a successfully created product as failed.

ProductBulkCreate.bulkProductWarnings ● [BulkProductWarning!]! non-null object​

Warnings on the created or updated products, each with the index of the input row its product came from. They are the product's own warnings. A product created without variants carries DEFAULT_VARIANT_REQUIRED until it gets one, so hasWarnings is true for each such product: look for a code instead, such as PRODUCT_ATTRIBUTE_VALUE_REQUIRED for a required attribute left without a value. Only a row whose product is in products has entries. A row refused only its image keeps its product, and so its warnings. A row whose attributes could not be written has none: its product is saved unpublished, and reported only in bulkProductErrors.

Returned By​

productBulkCreate mutation

Was this page helpful?