Mark query in manifest required (#280)
* Mark query in manifest required * Update tender-news-do.md
This commit is contained in:
parent
64e97ffb2b
commit
3e31b3a42f
2 changed files with 22 additions and 2 deletions
11
.changeset/tender-news-do.md
Normal file
11
.changeset/tender-news-do.md
Normal 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!
|
13
src/types.ts
13
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;
|
||||
|
|
Loading…
Reference in a new issue