Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
After creating webhook with webhookSubscriptionCreate mutation, when I check the payload it shows API version 2020-01 and the version it self do not matches with my version of admin API. How can i mention API version while doing the mutation.
I'm using Graphql with admin api version '2024-01'
The query:
mutation webhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) { webhookSubscriptionCreate( topic: $topic webhookSubscription: $webhookSubscription ) { userErrors { field message } webhookSubscription { id metafieldNamespaces includeFields apiVersion { handle supported } createdAt } } }
variables:
{
"topic": "PRODUCTS_DELETE",
"webhookSubscription": {
"callbackUrl": "https://abcd.trycloudflare.com/webhooks",
"format": "JSON"
}
}
payload:
-{ "data": { "webhookSubscriptionCreate": { "userErrors": [], "webhookSubscription": { "id": "gid://shopify/WebhookSubscription/1479423787327", "metafieldNamespaces": [], "includeFields": [], "apiVersion": { "handle": "2020-01", "supported": false }, "createdAt": "2024-03-07T06:20:41Z" } } }, "extensions": { "cost": { "requestedQueryCost": 11, "actualQueryCost": 11, "throttleStatus": { "maximumAvailable": 2000, "currentlyAvailable": 1989, "restoreRate": 100 } } } }