Anchor to webhookSubscriptionsCountwebhook
webhookSubscriptionsCount
query
The count of webhook subscriptions.
Building an app? If you only use app-specific webhooks, you won't need this. App-specific webhook subscriptions specified in your shopify.app.toml
may be easier. They are automatically kept up to date by Shopify & require less maintenance. Please read About managing webhook subscriptions. Limited to a maximum of 10000.
Anchor to Arguments
Arguments
- Anchor to queryquery•
A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about Shopify API search syntax.
Was this section helpful?
Anchor to Possible returnsPossible returns
- Anchor to CountCount•
Details for count of elements.
Was this section helpful?
Receive a count of all Webhooks
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query WebhookSubscriptionsCount($query: String!) {
webhookSubscriptionsCount(query: $query) {
count
precision
}
}`,
{
variables: {
"query": "topic:\"orders/create\""
},
},
);
const data = await response.json();
query WebhookSubscriptionsCount($query: String!) {
webhookSubscriptionsCount(query: $query) {
count
precision
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "query WebhookSubscriptionsCount($query: String!) { webhookSubscriptionsCount(query: $query) { count precision } }",
"variables": {
"query": "topic:\"orders/create\""
}
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query WebhookSubscriptionsCount($query: String!) {
webhookSubscriptionsCount(query: $query) {
count
precision
}
}`,
{
variables: {
"query": "topic:\"orders/create\""
},
},
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `query WebhookSubscriptionsCount($query: String!) {
webhookSubscriptionsCount(query: $query) {
count
precision
}
}`,
"variables": {
"query": "topic:\"orders/create\""
},
},
});
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
query WebhookSubscriptionsCount($query: String!) {
webhookSubscriptionsCount(query: $query) {
count
precision
}
}
QUERY
variables = {
"query": "topic:"orders/create""
}
response = client.query(query: query, variables: variables)
Input variables
JSON{
"query": "topic:\"orders/create\""
}
Response
JSON{
"webhookSubscriptionsCount": {
"count": 1,
"precision": "EXACT"
}
}