diff --git a/.changeset/tender-news-do.md b/.changeset/tender-news-do.md new file mode 100644 index 00000000..fe4960a3 --- /dev/null +++ b/.changeset/tender-news-do.md @@ -0,0 +1,11 @@ +--- +"@saleor/app-sdk": patch +--- + +Changed the "query" field in the AppManifest webhook to be required. Previously, this field was optional. + +For subscription events, Saleor rejects webhooks without query, so this field was valid only with legacy non-subscription webhooks. + +Now, the query is obligatory. + +Warning: This can be a breaking change for some scenarios where legacy webhooks were used! diff --git a/src/types.ts b/src/types.ts index f38fbcca..927d108d 100644 --- a/src/types.ts +++ b/src/types.ts @@ -213,8 +213,17 @@ export interface WebhookManifest { name: string; asyncEvents?: AsyncWebhookEventType[]; syncEvents?: SyncWebhookEventType[]; - /** If query is not provided, the default webhook payload will be used */ - query?: string; + /** + * Query is required for a subscription. + * If you don't need a payload, you can provide empty query like this: + * + * subscription { + * event { + * __typename + * } + * } + */ + query: string; /** The full URL of the endpoint where request will be sent */ targetUrl: string; isActive?: boolean;