Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add visibleInListings product type field
IKarbowiakb02db42466af
diff --git a/saleor/graphql/product/tests/test_product.py b/saleor/graphql/product/tests/test_product.pyindex 12cb2e440b..5babdec2bc 100644--- a/saleor/graphql/product/tests/test_product.py+++ b/saleor/graphql/product/tests/test_product.py@@ -122,6 +122,7 @@ QUERY_PRODUCT = """}availableForPurchaseisAvailableForPurchase+ visibleInListings}}"""@@ -130,13 +131,21 @@ QUERY_PRODUCT = """def test_product_query_by_id(user_api_client, product,):+ # given+ product.visible_in_listings = True+ product.save(update_fields=["visible_in_listings"])+variables = {"id": graphene.Node.to_global_id("Product", product.pk)}+ # whenresponse = user_api_client.post_graphql(QUERY_PRODUCT, variables=variables)++ # thencontent = get_graphql_content(response)product_data = content["data"]["product"]assert product_data is not Noneassert product_data["name"] == product.name+ assert product_data["visibleInListings"] is Truedef test_product_query_by_id_weight_returned_in_default_unit(diff --git a/saleor/graphql/product/types/products.py b/saleor/graphql/product/types/products.pyindex 5557b10151..3bf54f6068 100644--- a/saleor/graphql/product/types/products.py+++ b/saleor/graphql/product/types/products.py@@ -503,6 +503,7 @@ class Product(CountableDjangoObjectType):"seo_title","updated_at","weight",+ "visible_in_listings",]@staticmethoddiff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphqlindex 529e0192b3..9c91887bfd 100644--- a/saleor/graphql/schema.graphql+++ b/saleor/graphql/schema.graphql@@ -3638,6 +3638,7 @@ type Product implements Node & ObjectWithMetadata {chargeTaxes: Boolean!weight: WeightavailableForPurchase: Date+ visibleInListings: Boolean!privateMetadata: [MetadataItem]!metadata: [MetadataItem]!privateMeta: [MetaStore]! @deprecated(reason: "Use the `privetaMetadata` field. This field will be removed after 2020-07-31.")