Mark query in manifest required (#280)

* Mark query in manifest required

* Update tender-news-do.md
This commit is contained in:
Lukasz Ostrowski 2023-09-06 09:30:56 +02:00 committed by GitHub
parent 64e97ffb2b
commit 3e31b3a42f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 2 deletions

View file

@ -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!

View file

@ -213,8 +213,17 @@ export interface WebhookManifest {
name: string; name: string;
asyncEvents?: AsyncWebhookEventType[]; asyncEvents?: AsyncWebhookEventType[];
syncEvents?: SyncWebhookEventType[]; 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 */ /** The full URL of the endpoint where request will be sent */
targetUrl: string; targetUrl: string;
isActive?: boolean; isActive?: boolean;