Skip to content

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

Apply code review suggestions

IKarbowiak63b7e556d6cc
diff --git a/saleor/graphql/csv/enums.py b/saleor/graphql/csv/enums.py
index 37288c3971..1ff9c39d19 100644
--- a/saleor/graphql/csv/enums.py
+++ b/saleor/graphql/csv/enums.py
@@ -9,5 +9,17 @@ class ExportScope(graphene.Enum):
IDS = "ids"
FILTER = "filter"
+ @property
+ def description(self):
+ # pylint: disable=no-member
+ description_mapping = {
+ ExportScope.ALL.name: "Export all products.",
+ ExportScope.IDS.name: "Export products with given ids.",
+ ExportScope.FILTER.name: "Export the filtered products.",
+ }
+ if self.name in description_mapping:
+ return description_mapping[self.name]
+ raise ValueError("Unsupported enum value: %s" % self.value)
+
JobStatusEnum = to_enum(JobStatus)
diff --git a/saleor/graphql/csv/types.py b/saleor/graphql/csv/types.py
index 37ec7cfb87..c27c5aaa46 100644
--- a/saleor/graphql/csv/types.py
+++ b/saleor/graphql/csv/types.py
@@ -1,6 +1,5 @@
import graphene
from graphene import relay
-from graphene_federation import key
from graphql_jwt.exceptions import PermissionDenied
from ...core.permissions import AccountPermissions
@@ -9,13 +8,12 @@ from ..core.connection import CountableDjangoObjectType
from .enums import JobStatusEnum
-@key(fields="id")
class Job(CountableDjangoObjectType):
url = graphene.String(description="The URL of field to download.")
status = JobStatusEnum(description="Job status.")
class Meta:
- description = "Represents job data"
+ description = "Represents a data export job."
interfaces = [relay.Node]
model = models.Job
only_fields = [
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index 396cf226c9..de190f9587 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -5093,7 +5093,7 @@ type WishlistRemoveProductVariantMutation {
scalar _Any
-union _Entity = Address | ServiceAccount | User | Group | ProductVariant | Product | ProductType | Collection | Category | ProductImage | Job
+union _Entity = Address | ServiceAccount | User | Group | ProductVariant | Product | ProductType | Collection | Category | ProductImage
type _Service {
sdl: String