Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Remove pagination from webhook events query
Maciej Korycinskia9658ccfe206
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphqlindex 7f5faf6de0..76476e166f 100644--- a/saleor/graphql/schema.graphql+++ b/saleor/graphql/schema.graphql@@ -3328,7 +3328,7 @@ type ProductVariantUpdatePrivateMeta {type Query {webhook(id: ID!): Webhookwebhooks(filter: WebhookFilterInput, before: String, after: String, first: Int, last: Int): WebhookCountableConnection- webhookEvents(before: String, after: String, first: Int, last: Int): WebhookEventCountableConnection+ webhookEvents: [WebhookEvent]webhookSamplePayload(eventType: WebhookEventTypeEnum!): JSONStringtranslations(kind: TranslatableKinds!, before: String, after: String, first: Int, last: Int): TranslatableItemConnectionshop: Shop@@ -4321,17 +4321,6 @@ type WebhookEvent {name: String}-type WebhookEventCountableConnection {- pageInfo: PageInfo!- edges: [WebhookEventCountableEdge!]!- totalCount: Int-}--type WebhookEventCountableEdge {- node: WebhookEvent!- cursor: String!-}-enum WebhookEventTypeEnum {ANY_EVENTSORDER_CREATEDdiff --git a/saleor/graphql/webhook/schema.py b/saleor/graphql/webhook/schema.pyindex 7694bd3bcd..131e1aef88 100644--- a/saleor/graphql/webhook/schema.py+++ b/saleor/graphql/webhook/schema.py@@ -1,6 +1,6 @@import graphene-from ..core.fields import FilterInputConnectionField, PrefetchingConnectionField+from ..core.fields import FilterInputConnectionFieldfrom ..decorators import permission_requiredfrom .enums import WebhookEventTypeEnumfrom .filters import WebhookFilterInput@@ -27,7 +27,7 @@ class WebhookQueries(graphene.ObjectType):description="List of webhooks.",filter=WebhookFilterInput(description="Filtering options for webhooks."),)- webhook_events = PrefetchingConnectionField(+ webhook_events = graphene.List(WebhookEvent, description="List of all available webhook events.")diff --git a/tests/api/test_webhook.py b/tests/api/test_webhook.pyindex cdbf758617..8e442721b9 100644--- a/tests/api/test_webhook.py+++ b/tests/api/test_webhook.py@@ -514,13 +514,9 @@ def test_query_webhook_by_service_account_without_permission(WEBHOOK_EVENTS_QUERY = """{- webhookEvents(first:10){- edges{- node{- eventType- name- }- }+ webhookEvents{+ eventType+ name}}"""@@ -531,7 +527,7 @@ def test_query_webhook_events(staff_api_client, permission_manage_webhooks):staff_api_client.user.user_permissions.add(permission_manage_webhooks)response = staff_api_client.post_graphql(query)content = get_graphql_content(response)- webhook_events = content["data"]["webhookEvents"]["edges"]+ webhook_events = content["data"]["webhookEvents"]assert len(webhook_events) == len(WebhookEventType.CHOICES)