Skip to content

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

Unify descriptions of queries

Marcin Gębala5ec21b30d7ab
diff --git a/saleor/graphql/account/schema.py b/saleor/graphql/account/schema.py
index 3e005447fb..ce54ed1c7d 100644
--- a/saleor/graphql/account/schema.py
+++ b/saleor/graphql/account/schema.py
@@ -83,6 +83,7 @@ class ServiceAccountFilterInput(FilterInputObjectType):
class AccountQueries(graphene.ObjectType):
address_validation_rules = graphene.Field(
AddressValidationData,
+ description="Returns address validation rules.",
country_code=graphene.Argument(CountryCodeEnum, required=True),
country_area=graphene.Argument(graphene.String),
city=graphene.Argument(graphene.String),
@@ -94,7 +95,7 @@ class AccountQueries(graphene.ObjectType):
description="List of the shop's customers.",
query=graphene.String(description=DESCRIPTIONS["user"]),
)
- me = graphene.Field(User, description="Logged in user data.")
+ me = graphene.Field(User, description="Return the currently authenticated user.")
staff_users = FilterInputConnectionField(
User,
filter=StaffUserInput(),
@@ -114,8 +115,8 @@ class AccountQueries(graphene.ObjectType):
user = graphene.Field(
User,
- id=graphene.Argument(graphene.ID, required=True),
- description="Lookup a user by ID.",
+ id=graphene.Argument(graphene.ID, description="ID of the user.", required=True),
+ description="Lookup an user by ID.",
)
def resolve_address_validation_rules(
diff --git a/saleor/graphql/checkout/schema.py b/saleor/graphql/checkout/schema.py
index 725992c20b..27c7c54ea2 100644
--- a/saleor/graphql/checkout/schema.py
+++ b/saleor/graphql/checkout/schema.py
@@ -30,14 +30,16 @@ from .types import Checkout, CheckoutLine
class CheckoutQueries(graphene.ObjectType):
checkout = graphene.Field(
- Checkout, description="Single checkout.", token=graphene.Argument(graphene.UUID)
+ Checkout,
+ description="Lookup a checkout by token.",
+ token=graphene.Argument(graphene.UUID, description="The checkout's token"),
)
# FIXME we could optimize the below field
checkouts = DjangoConnectionField(Checkout, description="List of checkouts.")
checkout_line = graphene.Field(
CheckoutLine,
- id=graphene.Argument(graphene.ID),
- description="Single checkout line.",
+ id=graphene.Argument(graphene.ID, description="ID of the checkout line."),
+ description="Lookup a checkout line by ID.",
)
checkout_lines = PrefetchingConnectionField(
CheckoutLine, description="List of checkout lines"
diff --git a/saleor/graphql/discount/schema.py b/saleor/graphql/discount/schema.py
index d8a18d6d80..e997907899 100644
--- a/saleor/graphql/discount/schema.py
+++ b/saleor/graphql/discount/schema.py
@@ -35,7 +35,7 @@ class SaleFilterInput(FilterInputObjectType):
class DiscountQueries(graphene.ObjectType):
sale = graphene.Field(
Sale,
- id=graphene.Argument(graphene.ID, required=True),
+ id=graphene.Argument(graphene.ID, description="ID of the sale.", required=True),
description="Lookup a sale by ID.",
)
sales = FilterInputConnectionField(
@@ -46,7 +46,9 @@ class DiscountQueries(graphene.ObjectType):
)
voucher = graphene.Field(
Voucher,
- id=graphene.Argument(graphene.ID, required=True),
+ id=graphene.Argument(
+ graphene.ID, description="ID of the voucher.", required=True
+ ),
description="Lookup a voucher by ID.",
)
vouchers = FilterInputConnectionField(
diff --git a/saleor/graphql/menu/schema.py b/saleor/graphql/menu/schema.py
index 095630d433..7ea66a7400 100644
--- a/saleor/graphql/menu/schema.py
+++ b/saleor/graphql/menu/schema.py
@@ -22,26 +22,28 @@ from .types import Menu, MenuItem
class MenuQueries(graphene.ObjectType):
menu = graphene.Field(
Menu,
- id=graphene.Argument(graphene.ID),
- name=graphene.Argument(graphene.String, description="Menu name."),
- description="Lookup a menu by ID or name.",
+ id=graphene.Argument(graphene.ID, description="ID of the menu."),
+ name=graphene.Argument(graphene.String, description="The menu's name."),
+ description="Lookup a navigation menu by ID or name.",
)
menus = FilterInputConnectionField(
Menu,
query=graphene.String(description=DESCRIPTIONS["menu"]),
filter=MenuFilterInput(),
- description="List of the shop's menus.",
+ description="List of the storefront's menus.",
)
menu_item = graphene.Field(
MenuItem,
- id=graphene.Argument(graphene.ID, required=True),
+ id=graphene.Argument(
+ graphene.ID, description="ID of the menu item.", required=True
+ ),
description="Lookup a menu item by ID.",
)
menu_items = FilterInputConnectionField(
MenuItem,
query=graphene.String(description=DESCRIPTIONS["menu_item"]),
filter=MenuItemFilterInput(),
- description="List of the shop's menu items.",
+ description="List of the storefronts's menu items.",
)
def resolve_menu(self, info, **data):
diff --git a/saleor/graphql/order/schema.py b/saleor/graphql/order/schema.py
index ac6b91640f..acb5b82d0b 100644
--- a/saleor/graphql/order/schema.py
+++ b/saleor/graphql/order/schema.py
@@ -64,7 +64,7 @@ class OrderQueries(graphene.ObjectType):
order = graphene.Field(
Order,
description="Lookup an order by ID.",
- id=graphene.Argument(graphene.ID, required=True),
+ id=graphene.Argument(graphene.ID, description="ID of an order.", required=True),
)
orders = FilterInputConnectionField(
Order,
@@ -76,7 +76,7 @@ class OrderQueries(graphene.ObjectType):
status=graphene.Argument(
OrderStatusFilter, description="Filter order by status"
),
- description="List of the shop's orders.",
+ description="List of orders.",
)
draft_orders = FilterInputConnectionField(
Order,
@@ -85,19 +85,19 @@ class OrderQueries(graphene.ObjectType):
created=graphene.Argument(
ReportingPeriod, description="Filter draft orders from a selected timespan."
),
- description="List of the shop's draft orders.",
+ description="List of draft orders.",
)
orders_total = graphene.Field(
TaxedMoney,
- description="Total sales.",
- period=graphene.Argument(
- ReportingPeriod, description="Get total sales for selected span of time."
- ),
+ description="Return the total sales amount from a specific period.",
+ period=graphene.Argument(ReportingPeriod, description="A period of time."),
)
order_by_token = graphene.Field(
Order,
description="Lookup an order by token.",
- token=graphene.Argument(graphene.String, required=True),
+ token=graphene.Argument(
+ graphene.UUID, description="The order's token", required=True
+ ),
)
@permission_required("order.manage_orders")
diff --git a/saleor/graphql/page/schema.py b/saleor/graphql/page/schema.py
index 9d234e7ac4..9e5a179000 100644
--- a/saleor/graphql/page/schema.py
+++ b/saleor/graphql/page/schema.py
@@ -13,9 +13,9 @@ from .types import Page
class PageQueries(graphene.ObjectType):
page = graphene.Field(
Page,
- id=graphene.Argument(graphene.ID),
- slug=graphene.String(),
- description="Lookup a page by ID or by slug.",
+ id=graphene.Argument(graphene.ID, description="ID of the page."),
+ slug=graphene.String(description="The slug of the page."),
+ description="Lookup a page by ID or slug.",
)
pages = FilterInputConnectionField(
Page,
diff --git a/saleor/graphql/payment/schema.py b/saleor/graphql/payment/schema.py
index b02393bc1f..4d7ec319af 100644
--- a/saleor/graphql/payment/schema.py
+++ b/saleor/graphql/payment/schema.py
@@ -9,10 +9,18 @@ from .types import Payment
class PaymentQueries(graphene.ObjectType):
- payment = graphene.Field(Payment, id=graphene.Argument(graphene.ID))
+ payment = graphene.Field(
+ Payment,
+ description="Lookup a payment by ID.",
+ id=graphene.Argument(
+ graphene.ID, description="ID of the payment.", required=True
+ ),
+ )
payments = PrefetchingConnectionField(Payment, description="List of payments")
payment_client_token = graphene.Field(
- graphene.String, args={"gateway": PaymentGatewayEnum()}
+ graphene.String,
+ description="Return a new token for the payment gateway.",
+ gateway=graphene.Argument(PaymentGatewayEnum, description="A payment gateway."),
)
@permission_required("order.manage_orders")
diff --git a/saleor/graphql/product/schema.py b/saleor/graphql/product/schema.py
index a1831c1129..7131d7b226 100644
--- a/saleor/graphql/product/schema.py
+++ b/saleor/graphql/product/schema.py
@@ -125,7 +125,11 @@ from .types.attributes import AttributeSortingInput
class ProductQueries(graphene.ObjectType):
digital_content = graphene.Field(
- DigitalContent, id=graphene.Argument(graphene.ID, required=True)
+ DigitalContent,
+ description="Lookup a digital content by ID.",
+ id=graphene.Argument(
+ graphene.ID, description="ID of the digital content.", required=True
+ ),
)
digital_contents = PrefetchingConnectionField(
DigitalContent,
@@ -166,12 +170,16 @@ class ProductQueries(graphene.ObjectType):
)
category = graphene.Field(
Category,
- id=graphene.Argument(graphene.ID, required=True),
+ id=graphene.Argument(
+ graphene.ID, required=True, description="ID of the category."
+ ),
description="Lookup a category by ID.",
)
collection = graphene.Field(
Collection,
- id=graphene.Argument(graphene.ID, required=True),
+ id=graphene.Argument(
+ graphene.ID, description="ID of the collection.", required=True
+ ),
description="Lookup a collection by ID.",
)
collections = FilterInputConnectionField(
@@ -182,7 +190,9 @@ class ProductQueries(graphene.ObjectType):
)
product = graphene.Field(
Product,
- id=graphene.Argument(graphene.ID, required=True),
+ id=graphene.Argument(
+ graphene.ID, description="ID of the product.", required=True
+ ),
description="Lookup a product by ID.",
)
products = FilterInputConnectionField(
@@ -218,7 +228,9 @@ class ProductQueries(graphene.ObjectType):
)
product_type = graphene.Field(
ProductType,
- id=graphene.Argument(graphene.ID, required=True),
+ id=graphene.Argument(
+ graphene.ID, description="ID of the product type.", required=True
+ ),
description="Lookup a product type by ID.",
)
product_types = FilterInputConnectionField(
@@ -229,8 +241,10 @@ class ProductQueries(graphene.ObjectType):
)
product_variant = graphene.Field(
ProductVariant,
- id=graphene.Argument(graphene.ID, required=True),
- description="Lookup a variant by ID.",
+ id=graphene.Argument(
+ graphene.ID, description="ID of the product variant.", required=True
+ ),
+ description="Lookup a product variant by ID.",
)
product_variants = PrefetchingConnectionField(
ProductVariant,
diff --git a/saleor/graphql/shipping/schema.py b/saleor/graphql/shipping/schema.py
index 0b87cd89d2..9eef8e692e 100644
--- a/saleor/graphql/shipping/schema.py
+++ b/saleor/graphql/shipping/schema.py
@@ -19,7 +19,9 @@ from .types import ShippingZone
class ShippingQueries(graphene.ObjectType):
shipping_zone = graphene.Field(
ShippingZone,
- id=graphene.Argument(graphene.ID, required=True),
+ id=graphene.Argument(
+ graphene.ID, description="ID of the shipping zone.", required=True
+ ),
description="Lookup a shipping zone by ID.",
)
shipping_zones = PrefetchingConnectionField(
diff --git a/saleor/graphql/shop/schema.py b/saleor/graphql/shop/schema.py
index 04f3850013..40a27c442a 100644
--- a/saleor/graphql/shop/schema.py
+++ b/saleor/graphql/shop/schema.py
@@ -14,7 +14,7 @@ from .types import Shop
class ShopQueries(graphene.ObjectType):
- shop = graphene.Field(Shop, description="Represents a shop resources.")
+ shop = graphene.Field(Shop, description="Return information about the shop.")
def resolve_shop(self, _info):
return Shop()