Skip to main content

Create Product Option Value

Create Product Option Value

Creates a new value for an existing product option (like "Small", "Medium", "Large" for a Size option).

Usage​

This mutation must be called after creating a product option and before creating a product that uses this option value. The option value ID returned should be referenced when creating product variants.

Required Fields​

  • name: The display name of the option value (e.g., "Small", "Red", "Cotton")
  • optionId: The ID of the parent option (from CreateProductOption)
  • locale: The locale for the option value name
  • storeId: The store ID

Optional Fields​

  • handle: URL-friendly identifier (auto-generated if not provided)
  • id: For updating existing option values

Example Workflow​

  1. Create option: CreateProductOption (e.g., "Size")
  2. Create option values: CreateProductOptionValue (e.g., "Small", "Medium", "Large")
  3. Create product with variants using these option values

GraphQL Endpoint​

https://graphql.wuilt.com

Operation: CreateProductOptionValue​

Try It Out​

Query​

mutation CreateProductOptionValue($input: ProductOptionValueInput) {
createProductOptionValue(input: $input) {
id
name
handle
locale
option {
id
name
__typename
}
translations {
locale
name
__typename
}
__typename
}
}

Query Variables

1
2
3
4
5
6
7
8

Note: Make sure to change the storeId with your store ID. For guidance on how to get your store ID, reference the Store ID guide.

Authentication​

To use this query, you will need an API key. Click the "API Key" button in the navigation bar to enter your credentials.