Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
quickfix for created resolver in productvariant (#10072)
Jakub6c77053a9cbe
diff --git a/saleor/graphql/product/tests/test_variant.py b/saleor/graphql/product/tests/test_variant.pyindex 91c0366b7d..41bde00410 100644--- a/saleor/graphql/product/tests/test_variant.py+++ b/saleor/graphql/product/tests/test_variant.py@@ -95,6 +95,7 @@ def test_fetch_variant(unitvalue}+ created}}"""@@ -117,6 +118,7 @@ def test_fetch_variant(content = get_graphql_content(response)data = content["data"]["productVariant"]assert data["name"] == variant.name+ assert data["created"] == variant.created_at.isoformat()stocks_count = variant.stocks.count()assert len(data["deprecatedStocksByCountry"]) == stocks_countdiff --git a/saleor/graphql/product/types/products.py b/saleor/graphql/product/types/products.pyindex c9d4e1e87e..3f189f4786 100644--- a/saleor/graphql/product/types/products.py+++ b/saleor/graphql/product/types/products.py@@ -353,8 +353,8 @@ class ProductVariant(ChannelContextTypeWithMetadata, ModelObjectType):model = models.ProductVariant@staticmethod- def resolve_created(root: models.ProductVariant, _info):- return root.created_at+ def resolve_created(root: ChannelContext[models.ProductVariant], _info):+ return root.node.created_at@staticmethoddef resolve_channel(root: ChannelContext[models.Product], _info):