Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add query for authorization keys
Marcin Gębala709b2ed23ea8
diff --git a/saleor/graphql/core/types/shop.py b/saleor/graphql/core/types/shop.pyindex d2620a5ce5..70c3b0618c 100644--- a/saleor/graphql/core/types/shop.py+++ b/saleor/graphql/core/types/shop.py@@ -5,11 +5,17 @@ from django.conf import settingsfrom phonenumbers import COUNTRY_CODE_TO_REGION_CODEfrom ....core.permissions import get_permissions+from ....site import models as site_modelsfrom ...utils import format_permissions_for_displayfrom .common import CountryDisplay, LanguageDisplay, PermissionDisplayfrom .money import VAT+class AuthorizationKey(graphene.ObjectType):+ name = graphene.String(description='Name of the key.', required=True)+ key = graphene.String(description='Value of the key.', required=True)++class Domain(graphene.ObjectType):host = graphene.String(description='The host name of the domain.', required=True)@@ -23,6 +29,9 @@ class Domain(graphene.ObjectType):class Shop(graphene.ObjectType):+ authorization_keys = graphene.List(+ AuthorizationKey, description='List of configured authorization keys.',+ required=True)countries = graphene.List(CountryDisplay, description='List of countries available in the shop.',required=True)@@ -56,6 +65,9 @@ class Shop(graphene.ObjectType):Represents a shop resource containing general shop\'s dataand configuration.'''+ def resolve_authorization_keys(self, info):+ return site_models.AuthorizationKey.objects.all()+def resolve_countries(self, info):return [CountryDisplay(code=country[0], country=country[1])