Skip to content

Commit

Permalink
Mark query in manifest required (#280)
Browse files Browse the repository at this point in the history
* Mark query in manifest required

* Update tender-news-do.md
  • Loading branch information
lkostrowski authored Sep 6, 2023
1 parent 64e97ff commit 3e31b3a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .changeset/tender-news-do.md
Original file line number Diff line number Diff line change
@@ -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 changes: 11 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3e31b3a

Please sign in to comment.