Work

Shopify order lookup on Cloudflare Workers

A Cloudflare Worker that fetches customer orders from a Shopify development store through the Admin GraphQL API, using token auth.

Independent build

Client: Independent build

Role: Solo

Stack: Cloudflare Workers · JavaScript · Shopify Admin GraphQL API

Year: [TBD]

Overview

This is an independent proof of concept, not a client project and not a production system. It runs against a Shopify development store. A Cloudflare Worker takes a lookup request, calls the Admin GraphQL API with a token, and returns the matching orders.

The challenge

A storefront cannot call the Admin API directly, because the token must stay private. [TBD: what I wanted to find out by building this.]

Constraints

The store is a development store with test orders only. The Admin API token stays on the Worker, so it never reaches the browser. [VERIFY: confirm the token is stored as a Wrangler secret.] [TBD: any limits from the free tier or the API that I ran into.]

My contribution

I built all of it myself: the Worker, the GraphQL query and the token handling. [TBD: what else was part of the build, such as the demo page planned for later.]

Technical approach

The Worker receives a request, sends an Admin GraphQL query to the development store and returns the matching orders. [TBD: request format, input validation, response shape and error handling as built.]

Hard problems

[TBD: the problems that took the most thought, for example matching a customer to an order safely.]

Trade-offs

It is a proof of concept, so it skips things a production service needs. [TBD: list what is missing, such as rate limiting, caching and logging, once I confirm what is and is not in the code.]

Outcome

It works against the development store. [TBD: what I can say honestly about response times or behavior, measured, not guessed.]

What I learned

[TBD: one or two lessons from keeping an Admin API token behind a Worker.]