Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark query in manifest required #280

Merged
merged 2 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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