Skip to content

Build a storefront against real commerce data before you have a store (mock.shop) - #3075

Open
BobbyNguye wants to merge 1 commit into
openai:mainfrom
BobbyNguye:mock-shop-storefront
Open

Build a storefront against real commerce data before you have a store (mock.shop)#3075
BobbyNguye wants to merge 1 commit into
openai:mainfrom
BobbyNguye:mock-shop-storefront

Conversation

@BobbyNguye

Copy link
Copy Markdown

Summary

A function-calling recipe for a common situation: a developer is building an online shop, doesn't have a Shopify store yet, and needs real commerce data to build against. Instead of inventing a JSON file of fake products, the model uses mock.shop, Shopify's public Storefront API backed by 100+ fictional stores that needs no store, app, or access token.

The notebook gives the model three tools (list the store directory, read a store's llms.txt, run a Storefront API GraphQL query), then asks it to set up a backend for "a shop that sells handcrafted furniture." The model picks the furniture store from the directory, learns its collections, writes and runs the query, and the notebook renders the six products as a homepage grid with real images and prices. The last section shows that the query the model wrote runs unchanged against a real store: only the endpoint and a token change.

Motivation

Coding agents asked to "build a shop" tend to fabricate product data, which produces storefronts that work against fake data and break against real data. This recipe shows the pattern that avoids it and is fully runnable with only OPENAI_API_KEY; the commerce API side needs no credentials at all.

What's in the PR

  • examples/build_a_storefront_against_mock_data.ipynb, executed end to end with outputs saved (Responses API, gpt-5.5, function calling with previous_response_id).
  • registry.yaml entry (tags: functions, responses) and an authors.yaml entry.
  • .github/scripts/check_notebooks.py passes locally.

About the author

I work on mock.shop at Shopify. The recipe uses only public endpoints and Shopify's public docs: https://shopify.dev/docs/storefronts/headless/mock-shop

@BobbyNguye
BobbyNguye requested a review from a team as a code owner September 10, 2026 16:52

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1878dcb68b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread registry.yaml
- responses

- title: Build a storefront against real commerce data before you have a store
path: examples/build_a_storefront_against_mock_data.ipynb

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 Badge Move the notebook into a topic directory

This new notebook is registered directly under examples/, but new notebooks must be organized under examples/<topic>/. Move it into an appropriate topic folder, such as examples/shopify/, and update this registry path accordingly.

AGENTS.md reference: AGENTS.md:L3-L5

Useful? React with 👍 / 👎.

" return response.json()\n",
"\n",
"\n",
"if os.environ.get(\"SHOPIFY_STORE_DOMAIN\") and last_query:\n",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Require the storefront token before entering the live branch

When SHOPIFY_STORE_DOMAIN is set but SHOPIFY_STOREFRONT_ACCESS_TOKEN is absent, this condition enters the live branch and storefront_query_live raises KeyError, contradicting the preceding claim that the call runs only when both values are set. Check both environment variables before invoking the external service.

AGENTS.md reference: AGENTS.md:L20-L22

Useful? React with 👍 / 👎.

},
{
"cell_type": "code",
"execution_count": 2,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Clear the committed execution counts

The notebook commits execution counts 2 through 8 even though the repository requires lingering execution counts to be cleared before committing; the first executed setup cell is already null, making the saved numbering inconsistent as well. Clear the remaining execution_count fields after the final top-to-bottom run.

AGENTS.md reference: AGENTS.md:L20-L22

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant