Anchor to blogsCountblogs
blogsCount
query
Requires access scope or
access scope.
Count of blogs.
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 Blogs
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query BlogsCount {
blogsCount {
count
precision
}
}`,
);
const data = await response.json();
query BlogsCount {
blogsCount {
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 BlogsCount { blogsCount { count precision } }"
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query BlogsCount {
blogsCount {
count
precision
}
}`,
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: `query BlogsCount {
blogsCount {
count
precision
}
}`,
});
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 BlogsCount {
blogsCount {
count
precision
}
}
QUERY
response = client.query(query: query)
Response
JSON{
"blogsCount": {
"count": 3,
"precision": "EXACT"
}
}