Skip to content

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

Change returned eventType from String to WebhookEventTypeEnum

Maciej Korycinski9139e2fcc577
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index 932de19e7c..4dbc36710a 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -4315,7 +4315,7 @@ enum WebhookErrorCode {
}
type WebhookEvent {
- eventType: String
+ eventType: WebhookEventTypeEnum
}
enum WebhookEventTypeEnum {
diff --git a/saleor/graphql/webhook/types.py b/saleor/graphql/webhook/types.py
index c1448f87c6..217901c098 100644
--- a/saleor/graphql/webhook/types.py
+++ b/saleor/graphql/webhook/types.py
@@ -3,10 +3,11 @@ import graphene_django_optimizer as gql_optimizer
from ...webhook import models
from ..core.connection import CountableDjangoObjectType
+from .enums import WebhookEventTypeEnum
class WebhookEvent(graphene.ObjectType):
- event_type = graphene.String(description="Name of the event type.")
+ event_type = WebhookEventTypeEnum(description="Name of the event type.")
class Meta:
description = "Webhook event."