Skip to content

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

Add missing requires

dominik-zeglen625b651d0496
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index 2464800d1a..5deca93838 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -3678,7 +3678,7 @@ type Query {
translation(id: ID!, kind: TranslatableKinds!): TranslatableItem
stock(id: ID!): Stock
stocks(filter: StockFilterInput, before: String, after: String, first: Int, last: Int): StockCountableConnection
- shop: Shop
+ shop: Shop!
shippingZone(id: ID!): ShippingZone
shippingZones(before: String, after: String, first: Int, last: Int): ShippingZoneCountableConnection
digitalContent(id: ID!): DigitalContent
@@ -4911,13 +4911,13 @@ input WarehouseUpdateInput {
}
type Webhook implements Node {
- name: String
+ name: String!
serviceAccount: ServiceAccount!
targetUrl: String!
isActive: Boolean!
secretKey: String
id: ID!
- events: [WebhookEvent]
+ events: [WebhookEvent!]!
}
type WebhookCountableConnection {
@@ -4967,8 +4967,8 @@ enum WebhookErrorCode {
}
type WebhookEvent {
- eventType: WebhookEventTypeEnum
- name: String
+ eventType: WebhookEventTypeEnum!
+ name: String!
}
enum WebhookEventTypeEnum {
diff --git a/saleor/graphql/webhook/types.py b/saleor/graphql/webhook/types.py
index 4d12a704c9..b469ab999d 100644
--- a/saleor/graphql/webhook/types.py
+++ b/saleor/graphql/webhook/types.py
@@ -8,8 +8,10 @@ from .enums import WebhookEventTypeEnum
class WebhookEvent(CountableDjangoObjectType):
- name = graphene.String(description="Display name of the event.")
- event_type = WebhookEventTypeEnum(description="Internal name of the event type.")
+ name = graphene.String(description="Display name of the event.", required=True)
+ event_type = WebhookEventTypeEnum(
+ description="Internal name of the event type.", required=True
+ )
class Meta:
model = models.WebhookEvent
@@ -22,8 +24,13 @@ class WebhookEvent(CountableDjangoObjectType):
class Webhook(CountableDjangoObjectType):
+ name = graphene.String(required=True)
events = gql_optimizer.field(
- graphene.List(WebhookEvent, description="List of webhook events."),
+ graphene.List(
+ graphene.NonNull(WebhookEvent),
+ description="List of webhook events.",
+ required=True,
+ ),
model_field="events",
)