← back to Rebel Walls Push
scripts/verify-live.js
16 lines
'use strict';
const { gqlRetry } = require('./_shop');
(async () => {
const q = async (query) => {
const r = await gqlRetry(`query($q:String!){ productsCount(query:$q){ count } }`, { q: query }, 'count');
if (r.json.errors) { console.error(query, '->', JSON.stringify(r.json.errors).slice(0,200)); return null; }
return r.json.data.productsCount.count;
};
const vendor = "vendor:'Rebel Walls'";
const total = await q(vendor);
const active = await q(`${vendor} AND status:active`);
const draft = await q(`${vendor} AND status:draft`);
const arch = await q(`${vendor} AND status:archived`);
console.log(JSON.stringify({ vendor_total: total, active, draft, archived: arch }, null, 2));
})().catch(e => { console.error('ERR', e.message); process.exit(1); });