Skip to content

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

Improve descriptions of file upload fields

Marcin Gębala53bcc8e338b9
diff --git a/saleor/graphql/file_upload/types.py b/saleor/graphql/file_upload/types.py
index 59e48d173f..06d96f1e6a 100644
--- a/saleor/graphql/file_upload/types.py
+++ b/saleor/graphql/file_upload/types.py
@@ -2,6 +2,13 @@ import graphene
class Upload(graphene.types.Scalar):
+
+ class Meta:
+ description = '''Variables of this type must be set to null in
+ mutations. They will be replaced with a filename from a following
+ multipart part containing a binary file. See:
+ https://github.com/jaydenseric/graphql-multipart-request-spec'''
+
@staticmethod
def serialize(value):
return value
diff --git a/saleor/graphql/product/mutations/products.py b/saleor/graphql/product/mutations/products.py
index 04e465fb65..18c26eba94 100644
--- a/saleor/graphql/product/mutations/products.py
+++ b/saleor/graphql/product/mutations/products.py
@@ -365,7 +365,6 @@ class ProductVariantDelete(ModelDeleteMutation):
class ProductTypeInput(graphene.InputObjectType):
-
name = graphene.String(description='Name of the product type.')
has_variants = graphene.Boolean(
required=True,
@@ -430,7 +429,9 @@ class ProductTypeDelete(ModelDeleteMutation):
class ProductImageCreateInput(graphene.InputObjectType):
alt = graphene.String(description='Alt text for an image.')
- image = Upload(required=True, description='Image field.')
+ image = Upload(
+ required=True,
+ description='Represents an image file in a multipart request.')
product = graphene.ID(description='ID of an product.')
@@ -441,7 +442,9 @@ class ProductImageCreate(ModelMutation):
description='Fields required to create a product image.')
class Meta:
- description = 'Creates a product image.'
+ description = '''Create a product image. This mutation must be sent
+ as a `multipart` request. More detailed specs of the upload format can
+ be found here: https://github.com/jaydenseric/graphql-multipart-request-spec'''
model = models.ProductImage
@classmethod