Skip to content

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

Merge branch 'master' into feature/add_sample_payload_to_webhook_event

Maciej Korycinski5e62867f4e42
diff --cc saleor/graphql/webhook/schema.py
index e772aad977,7fcedc5599..d3848faa50
--- a/saleor/graphql/webhook/schema.py
+++ b/saleor/graphql/webhook/schema.py
@@@ -11,23 -10,12 +11,24 @@@ class WebhookQueries(graphene.ObjectTyp
webhook = graphene.Field(
Webhook,
id=graphene.Argument(
- graphene.ID, required=True, description="ID of the webhook"
+ graphene.ID, required=True, description="ID of the webhook."
),
- description="Lookup a webhook by ID.",
+ description="Look up a webhook by ID.",
)
- webhooks = PrefetchingConnectionField(Webhook, description="List of webhooks")
+ webhooks = PrefetchingConnectionField(Webhook, description="List of webhooks.")
+
+ webhook_sample_payload = graphene.Field(
+ graphene.JSONString,
+ event_type=graphene.Argument(
+ WebhookEventTypeEnum,
+ required=True,
+ description="Name of the reguested event type.",
+ ),
+ )
+
+ def resolve_webhook_sample_payload(self, info, **data):
+ return resolve_sample_payload(info, data["event_type"])
+
def resolve_webhooks(self, info, **_kwargs):
return resolve_webhooks(info)