[object Object]

← back to Shopify Sample Shipping

Add read-only Shopify shipping inspection

498483fb0612a1285013a6b7e494b6f5ce744240 · 2026-09-09 12:56:39 -0700 · Steve Abrams

Files touched

Diff

commit 498483fb0612a1285013a6b7e494b6f5ce744240
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed Sep 9 12:56:39 2026 -0700

    Add read-only Shopify shipping inspection
---
 .gitignore       |  8 ++++++++
 profiles.graphql |  1 +
 query.mjs        | 19 +++++++++++++++++++
 3 files changed, 28 insertions(+)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..1924158
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
+node_modules/
+.env*
+tmp/
+*.log
+.DS_Store
+dist/
+build/
+.next/
diff --git a/profiles.graphql b/profiles.graphql
new file mode 100644
index 0000000..965a739
--- /dev/null
+++ b/profiles.graphql
@@ -0,0 +1 @@
+{deliveryProfiles(first:30){pageInfo{hasNextPage endCursor} nodes{id name default profileLocationGroups{locationGroup{id} locationGroupZones(first:25){pageInfo{hasNextPage} nodes{zone{id name} methodDefinitions(first:10){pageInfo{hasNextPage} nodes{id name active methodConditions{id field operator conditionCriteria{__typename ... on Weight{value unit} ... on MoneyV2{amount currencyCode}}} rateProvider{__typename ... on DeliveryRateDefinition{id price{amount currencyCode}}}}}}}}}}}
diff --git a/query.mjs b/query.mjs
new file mode 100644
index 0000000..398e2f9
--- /dev/null
+++ b/query.mjs
@@ -0,0 +1,19 @@
+import fs from 'node:fs';
+import { TOKEN, SHOP } from '../designerwallcoverings/scripts/lib/shopify.mjs';
+export async function query(query, variables = {}) {
+  const r = await fetch(`https://${SHOP}/admin/api/2026-07/graphql.json`, {
+    method: 'POST',
+    headers: { 'X-Shopify-Access-Token': TOKEN, 'Content-Type': 'application/json' },
+    body: JSON.stringify({query, variables}), signal: AbortSignal.timeout(30000)
+  });
+  const j = await r.json();
+  if (!r.ok || j.errors) throw new Error(JSON.stringify({status:r.status, errors:j.errors}));
+  return j.data;
+}
+if (process.argv[1]?.endsWith('/query.mjs')) {
+  const q = fs.readFileSync(process.argv[2], 'utf8');
+  if (/\bmutation\b/.test(q)) throw new Error('Read-only query runner');
+  const j = await query(q);
+  fs.writeFileSync(process.argv[3], JSON.stringify(j,null,2)+'\n');
+  console.log('Saved',process.argv[3]);
+}

(oldest)  ·  back to Shopify Sample Shipping  ·  Prepare sample-only shipping profile with rate snapshots and ccec1fc →