Skip to main content

Create Product Attribute Value

Create Product Attribute Value

Creates a new value for an existing product attribute (like "Cotton", "Polyester" for a Material attribute).

Usage​

This mutation must be called after creating a product attribute and before creating a product that uses this attribute value.

Required Fields​

  • name: The display name of the attribute value (e.g., "Cotton", "Nike", "Blue")
  • attributeId: The ID of the parent attribute (from CreateProductAttribute)
  • locale: The locale for the attribute value name
  • storeId: The store ID

Optional Fields​

  • image: Optional image for the attribute value (useful for color swatches, etc.)

Example Workflow​

  1. Create attribute: CreateProductAttribute (e.g., "Material")
  2. Create attribute values: CreateProductAttributeValue (e.g., "Cotton", "Polyester", "Silk")
  3. Create product and assign these attribute values to describe the product

GraphQL Endpoint​

https://graphql.wuilt.com

Operation: CreateProductAttributeValue​

Try It Out​

Query​

mutation CreateProductAttributeValue(
$input: CreateProductAttributeValueInput!
) {
createProductAttributeValue(input: $input) {
id
name
locale
image {
id
src
altText
width
height
__typename
}
attribute {
id
name
type
__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.