Skip to content

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

Decorate 'resolve_disocunts' with 'prevent_sync_event_circular_query' (#16124)

Piotr Zabieglik1655a09801b9
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 590be08758..1fc4c4583a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -42,6 +42,7 @@ All notable, unreleased changes to this project will be documented in this file.
- Drop `OrderBulkCreateInput.voucher` field. Use `OrderBulkCreateInput.voucherCode` instead. - #14553 by @zedzior
- Add new `type` field to `PromotionCreateInput`, the field will be required from 3.20 - #14696 by @IKarbowiak, @zedzior
- Do not stack promotion rules within the promotion. Only the best promotion rule will be applied within the promotion. Previously discounts from all rules within the promotion that gives the best discount were applied to the variant's price - #15309 by @korycins
+- Disable the `order.discounts` field in sync events to prevent circular calls - #16111 by @zedzior
### GraphQL API
diff --git a/saleor/graphql/order/types.py b/saleor/graphql/order/types.py
index 2fcb1d2b55..4a6c6e36c0 100644
--- a/saleor/graphql/order/types.py
+++ b/saleor/graphql/order/types.py
@@ -1572,6 +1572,7 @@ class Order(ModelObjectType[models.Order]):
return root.id
@staticmethod
+ @prevent_sync_event_circular_query
def resolve_discounts(root: models.Order, info):
@allow_writer_in_context(info.context)
def with_manager(manager):