Internal tools · 8 min read
The Shopify variant fetch UI our catalog engineers actually use
A React product variant harvest tool on the Shopify Admin GraphQL API: selective vendor pulls into PostgreSQL staging, no manual SQL for store catalogs.
Why pull your Shopify catalog into a database in the first place?
Because every system downstream of the store needs a clean copy of the truth, and the Shopify admin is not a database you can query. A large furniture retailer we work with runs tens of thousands of variants on Shopify Plus. Sofas in five fabrics, beds in three sizes, sectional pieces sold as a set or on their own. Every system we operate for them reads the catalog out of PostgreSQL Shopify catalog staging tables, not out of Shopify directly. That covers vendor feed cleanup, pricing audits, and AI enrichment alike.
The obvious question is why not just keep the Shopify catalog staging layer in sync on a schedule. We do that too. But the daily reality of catalog work is messier. A vendor renames 200 SKUs and someone needs to see what the store actually shows right now. A merchandiser swears a collection went live, but the staging table has no rows for it. A pricing discrepancy surfaces for one brand, and you want a fresh pull of just that vendor's variants today, not at the next scheduled run.
The old escape hatch was someone hand-writing a one-off script, or worse, opening a database tool and typing SQL. Pulling a vendor's variants through the Shopify Admin GraphQL API means paging through results one screen at a time, translating Shopify's internal IDs into numbers, filtering out anything not published, and saving rows so a second run updates them instead of duplicating them. A product variant harvest tool removes all of that friction. We had run the pull often enough that the script deserved a front end.
How do you harvest every variant from a Shopify store without writing SQL?
With a form instead of a script. Our internal shopify-fetch-ui app is a small React web application that turns the whole pull into something an operator can run from a browser. It is, in plain terms, a product variant harvest tool: an operator picks a vendor (or another Shopify search filter), kicks off the harvest, and watches the run's progress. Under the hood the UI calls the same fetch code our scheduled pulls use: a short-lived cloud job that walks the store's product list through the Shopify Admin GraphQL API, cleans up each variant, and saves it into the client's Postgres staging tables.
The key property is that Shopify catalog staging stays the interface. The UI never writes to Shopify. The access token is read-only, the search uses Shopify's own query box filtered by the operator's criteria, and everything it returns lands in a staging table that downstream systems already know how to read. No manual SQL, no one-off scripts on a laptop, no "which version of the pull did you run" ambiguity.
How do you fetch every product through the Shopify Admin GraphQL API?
Three pieces, each boring on purpose.
A small browser front end. It is a query builder and a run monitor: pick the vendor, optionally narrow by collection or tag, fire the request, and watch counts roll in page by page. This is what makes it a usable product variant harvest tool rather than a script only its author can run. Operators see products fetched, variants saved, and items skipped per run, instead of a silent server log.
Shopify Admin GraphQL, read one page at a time. The fetcher issues one query template against the Admin API asking for 50 products per page, with Shopify remembering where the last page ended. On each product it pulls the handle, title, vendor, status, storefront URL, and the first page of variants with SKU, price, compare-at price, and inventory IDs. GraphQL earns its place here for two reasons. First, its search argument speaks Shopify's own syntax, so "vendor X" or "tag Y and status active" is one input rather than a filter we build ourselves over a full catalog dump. Second, we ask for exactly the fields staging stores, so pages stay small and we remain comfortably under Shopify's API rate limits. A typical vendor harvest is tens of requests, not thousands.
A safe save into Postgres. Each harvested variant becomes one row, keyed on the client plus the variant so nothing duplicates. Products without a live storefront URL are skipped: if it is not published to the online store, it does not belong in a storefront-facing staging feed. Re-running the same harvest is safe. It refreshes a timestamp on each row and changes nothing else. The fetch job even creates the staging table if it is missing, so pointing the tool at a fresh database is a legitimate way to start a new staging area.
The UI sits behind the same sign-in and rate limiting as the rest of our internal tooling, described in how we built the auth microservice, so every harvest is tied to a team member rather than an anonymous script. The staged rows feed the same Shopify catalog staging tables that our catalog API and pipeline orchestrator treat as the source of truth for health checks and downstream syncs.
How long does a Shopify catalog export take, and what does it cost?
Seconds, not hours, and it costs what one short-lived cloud job costs. The front end is a static build, and the fetch path is one job per harvest plus the database write, with no always-on server in the loop. A vendor harvest of a few thousand products is a single run measured in seconds of wall time, paging at whatever pace Shopify's rate limit allows. Costs are effectively those short runs plus a modest managed Postgres bill, which is the same shape as the rest of the platform.
Operationally, the audit angle is the quiet win. Every harvest is a logged run rather than someone's throwaway script, so we can answer "when was vendor X last pulled, and how many variants did it return" without digging through raw server logs. When a count drops unexpectedly between two runs of the same vendor, that is a signal worth looking at. A product variant harvest tool surfaces it as a number an operator can see, not a row count buried in a log line.
Why stage Shopify products in Postgres instead of exporting a CSV?
Because a CSV export is a dead snapshot the moment it lands, while Shopify catalog staging is the plumbing every other system drinks from. Enrichment pipelines, pricing checks, availability rollups, and the storefront itself all assume the staging tables are fresh and complete for the slice of catalog they care about. A product variant harvest tool that any engineer can run safely, without opening a database tool and hoping, removes the last manual step between "something looks wrong in the store" and "here is the ground truth, pulled through the Shopify Admin GraphQL API five minutes ago."
The broader pattern is one we keep applying: when a script gets run more than a few times by more than one person, it graduates to a tool with a UI, attribution, and an audit trail. Internal tools are not glamorous, but they are where operational quality actually lives.
Questions this answers
How do I export all of my Shopify products into a database?
Read the store's product list through the Shopify Admin GraphQL API with a search filter, then save each variant into a staging table. We wrapped that flow in a UI so an operator can run a pull from a browser instead of writing SQL.
Can you pull Shopify products for just one vendor or collection?
Yes. The Admin GraphQL product search accepts Shopify's own search syntax, so filtering by vendor, tag, or status is a built-in option rather than something we screen for after downloading everything. Scoped pulls are how we re-harvest a single brand when a vendor renames 200 SKUs.
How is a GraphQL catalog harvest different from Shopify's CSV export?
A CSV is a manual snapshot that goes stale the moment it lands. An API harvest is re-runnable and selective, and it lands directly in Postgres. Because rows are keyed on the variant, running the same pull twice just refreshes timestamps instead of duplicating anything.
How long does a full Shopify catalog export take?
A vendor harvest of a few thousand products is a single run measured in seconds of wall time. Paging speed is set by Shopify's API rate limits, so a typical pull is tens of requests, not thousands.
Does pulling my catalog through the Admin API change anything in my store?
No. The token is read-only and the fetcher never writes to Shopify. Everything it returns lands in a PostgreSQL staging table, which downstream systems treat as the copy of record.
How do you keep unpublished or draft products out of a Shopify export?
Filter on publication state. In our harvest, products without a live storefront URL are skipped, since anything not published to the online store does not belong in a storefront-facing staging feed.
What is Shopify catalog staging?
A set of PostgreSQL tables that mirror your store's products and variants, so internal tools can query the catalog without hitting the Admin API on every read. Ours feed the catalog pipeline orchestrator that runs health checks and downstream syncs.
Still hand-rolling scripts against the Admin API?
If your team is still hand-rolling scripts against the Admin API or staging Shopify data in spreadsheets, we can help. Get in touch to talk about Shopify catalog staging and product pipelines for your store, or run our agent readiness check to see how your storefront looks to the next generation of AI shoppers.