Skip to content

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

Add missing webhook event info structure (#18892)

Maciej Korycinski1cc263035113
diff --git a/saleor/graphql/checkout/mutations/checkout_delivery_method_update.py b/saleor/graphql/checkout/mutations/checkout_delivery_method_update.py
index 6173b1b799..0e0a45d62f 100644
--- a/saleor/graphql/checkout/mutations/checkout_delivery_method_update.py
+++ b/saleor/graphql/checkout/mutations/checkout_delivery_method_update.py
@@ -73,6 +73,13 @@ class CheckoutDeliveryMethodUpdate(BaseMutation):
"the external one."
),
),
+ WebhookEventInfo(
+ type=WebhookEventSyncType.CHECKOUT_FILTER_SHIPPING_METHODS,
+ description=(
+ "Optionally triggered when cached filtered shipping methods are "
+ "invalid."
+ ),
+ ),
WebhookEventInfo(
type=WebhookEventAsyncType.CHECKOUT_UPDATED,
description="A checkout was updated.",
diff --git a/saleor/graphql/checkout/mutations/checkout_shipping_method_update.py b/saleor/graphql/checkout/mutations/checkout_shipping_method_update.py
index 55fd7dfdaf..dcae0cce92 100644
--- a/saleor/graphql/checkout/mutations/checkout_shipping_method_update.py
+++ b/saleor/graphql/checkout/mutations/checkout_shipping_method_update.py
@@ -71,6 +71,13 @@ class CheckoutShippingMethodUpdate(BaseMutation):
"the external one."
),
),
+ WebhookEventInfo(
+ type=WebhookEventSyncType.CHECKOUT_FILTER_SHIPPING_METHODS,
+ description=(
+ "Optionally triggered when cached filtered shipping methods are "
+ "invalid."
+ ),
+ ),
WebhookEventInfo(
type=WebhookEventAsyncType.CHECKOUT_UPDATED,
description="A checkout was updated.",
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index e5c05eff5a..f5d4177de0 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -20924,6 +20924,7 @@ type Mutation {
Triggers the following webhook events:
- SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Triggered when updating the checkout shipping method with the external one.
+ - CHECKOUT_FILTER_SHIPPING_METHODS (sync): Optionally triggered when cached filtered shipping methods are invalid.
- CHECKOUT_UPDATED (async): A checkout was updated.
"""
checkoutShippingMethodUpdate(
@@ -20938,13 +20939,14 @@ type Mutation {
"""Checkout token."""
token: UUID @deprecated(reason: "Use `id` instead.")
- ): CheckoutShippingMethodUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT]) @deprecated(reason: "Use `checkoutDeliveryMethodUpdate` instead.")
+ ): CheckoutShippingMethodUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT, CHECKOUT_FILTER_SHIPPING_METHODS]) @deprecated(reason: "Use `checkoutDeliveryMethodUpdate` instead.")
"""
Updates the delivery method (shipping method or pick up point) of the checkout. Updates the checkout shipping_address for click and collect delivery for a warehouse address.
Triggers the following webhook events:
- SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Triggered when updating the checkout delivery method with the external one.
+ - CHECKOUT_FILTER_SHIPPING_METHODS (sync): Optionally triggered when cached filtered shipping methods are invalid.
- CHECKOUT_UPDATED (async): A checkout was updated.
"""
checkoutDeliveryMethodUpdate(
@@ -20956,7 +20958,7 @@ type Mutation {
"""Checkout token."""
token: UUID @deprecated(reason: "Use `id` instead.")
- ): CheckoutDeliveryMethodUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT])
+ ): CheckoutDeliveryMethodUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT, CHECKOUT_FILTER_SHIPPING_METHODS])
"""
Updates language code in the existing checkout.
@@ -30936,9 +30938,10 @@ Updates the shipping method of the checkout.
Triggers the following webhook events:
- SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Triggered when updating the checkout shipping method with the external one.
+- CHECKOUT_FILTER_SHIPPING_METHODS (sync): Optionally triggered when cached filtered shipping methods are invalid.
- CHECKOUT_UPDATED (async): A checkout was updated.
"""
-type CheckoutShippingMethodUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT]) {
+type CheckoutShippingMethodUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT, CHECKOUT_FILTER_SHIPPING_METHODS]) {
"""An updated checkout."""
checkout: Checkout
checkoutErrors: [CheckoutError!]! @deprecated(reason: "Use `errors` field instead.")
@@ -30950,9 +30953,10 @@ Updates the delivery method (shipping method or pick up point) of the checkout.
Triggers the following webhook events:
- SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Triggered when updating the checkout delivery method with the external one.
+- CHECKOUT_FILTER_SHIPPING_METHODS (sync): Optionally triggered when cached filtered shipping methods are invalid.
- CHECKOUT_UPDATED (async): A checkout was updated.
"""
-type CheckoutDeliveryMethodUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT]) {
+type CheckoutDeliveryMethodUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT, CHECKOUT_FILTER_SHIPPING_METHODS]) {
"""An updated checkout."""
checkout: Checkout
errors: [CheckoutError!]!