Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Don't require value field in attribute value mutations

Marcin Gębala257f608fcb68
diff --git a/saleor/graphql/product/mutations/attributes.py b/saleor/graphql/product/mutations/attributes.py
index d561ad2b19..27a266c8c8 100644
--- a/saleor/graphql/product/mutations/attributes.py
+++ b/saleor/graphql/product/mutations/attributes.py
@@ -14,7 +14,8 @@ class AttributeCreateValueInput(graphene.InputObjectType):
name = graphene.String(
required=True, description='Name displayed in the interface.')
value = graphene.String(
- required=True, description='Real value eg. HEX color.')
+ description='''Value different than a textual name e.g. color
+ in a hexadecimal format.''')
class AttributeCreateInput(graphene.InputObjectType):
diff --git a/saleor/graphql/product/types.py b/saleor/graphql/product/types.py
index 7ab987b7d8..cb60777a11 100644
--- a/saleor/graphql/product/types.py
+++ b/saleor/graphql/product/types.py
@@ -62,6 +62,9 @@ class AttributeValue(CountableDjangoObjectType):
slug = graphene.String(
description='Internal representation of an attribute name.')
type = AttributeValueType(description='Type of value.')
+ value = graphene.String(
+ description='''Value different than a textual name e.g. color
+ in a hexadecimal format.''')
class Meta:
description = 'Represents a value of an attribute.'
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index 1412b6c8e6..a478ff1531 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -135,7 +135,7 @@ input AttributeCreateInput {
input AttributeCreateValueInput {
name: String!
- value: String!
+ value: String
}
type AttributeDelete {
@@ -167,7 +167,7 @@ type AttributeValue implements Node {
id: ID!
sortOrder: Int!
name: String
- value: String!
+ value: String
slug: String
type: AttributeValueType
}