Product Options Delete Payload
Return type for mutation.
Anchor to FieldsFields
- deletedOptionsIds ([ID!])
- product (Product)
- userErrors ([ProductOptionsDeleteUserError!]!)
- Anchor to deletedOptionsIdsdeleted•[ID!]
Options Ids IDs of the options deleted.
- Anchor to productproduct•Product
The updated product object.
- Anchor to userErrorsuser•[Product
Errors Options Delete User Error!]! non-null The list of errors that occurred from executing the mutation.
Anchor to Mutations with this payloadMutations with this payload
- productOptionsDelete (ProductOptionsDeletePayload)
- •mutation
Deletes one or more options from a product. Product options define the choices available for a product, such as size, color, or material.
CautionCaution: Removing an option can affect a product's <a href="https://shopify.dev/docs/api/admin-graphql/latest/objects/ProductVariant">variants</a> and their configuration. Deleting an option might also delete associated option values and, depending on the chosen <a href="https://shopify.dev/docs/api/admin-graphql/latest/mutations/productoptionsdelete#arguments-strategy">strategy</a>, might affect variants.
Use the
mutation for the following use cases:- Simplify product configuration: Remove obsolete or unnecessary options (for example, discontinue "Material" if all variants are now the same material).
- Clean up after seasonal or limited-time offerings: Delete options that are no longer relevant (for example, "Holiday edition").
- Automate catalog management: Enable apps or integrations to programmatically remove options as product data changes.
NoteThe
mutation enforces strict data integrity for product options and variants. All option positions must remain sequential, and every remaining option must be used by at least one variant.Note:The
mutation enforces strict data integrity for product options and variants. All option positions must remain sequential, and every remaining option must be used by at least one variant.Note: The <code><span class="PreventFireFoxApplyingGapToWBR">product<wbr/>Options<wbr/>Delete</span></code> mutation enforces strict data integrity for product options and variants. All option positions must remain sequential, and every remaining option must be used by at least one variant.
After you delete a product option, you can further manage a product's configuration using related mutations:
Learn more about the product model and adding product data.
- Anchor to productIdproduct•ID!
Id required ID of the product from which to delete the options.
- Anchor to optionsoptions•[ID!]!required
IDs of the options to delete from the product.
- Anchor to strategystrategy•Product
Option Delete Strategy Default:DEFAULT The strategy defines which behavior the mutation should observe,such as how to handle a situation where deleting an option would result in duplicate variants.
Arguments