Replace @shopify/hydrogen with direct Storefront API queries

Vercel's 'Hydrogen (v1)' preset matches any project depending on
@shopify/hydrogen and runs its v1 builder, which fails looking for
dist/worker. We only used the preview package as a Storefront API client,
so talk to the API directly instead:

- services/shopify/client.ts: plain fetch to /api/{version}/graphql.json
  with the public token header, @inContext country/language defaults, and
  the same graphql() / unwrapStorefrontResult API as before
- graphql/gql.ts: small helper that joins a document with its fragments
  (de-duplicated); the queries themselves are unchanged
- Explicit response types at each call site in place of the generated
  gql.tada types; local ProductFilter input type
- Drop @shopify/hydrogen, graphql, the TS plugin and 'hydrogen gql check'
- Copy no longer mentions Hydrogen

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Rami Bitar
2026-10-03 15:28:02 -04:00
co-authored by Claude Opus 5.5
parent d33a6894f3
commit 6fcfe59d0d
20 changed files with 273 additions and 249 deletions
-116
View File
@@ -5,31 +5,6 @@ __metadata:
version: 10
cacheKey: 10c0
"@0no-co/graphql.web@npm:^1.0.5, @0no-co/graphql.web@npm:^1.3.1":
version: 1.3.4
resolution: "@0no-co/graphql.web@npm:1.3.4"
peerDependencies:
graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0
peerDependenciesMeta:
graphql:
optional: true
checksum: 10c0/58c61e16664121bd0974609890bf68135469fa1af23c70c3966cf50f0215efac7062a4ff2ded60faaf7575e420b73c0800467e46fc0440942d48490d2f6c13bd
languageName: node
linkType: hard
"@0no-co/graphqlsp@npm:^1.12.13":
version: 1.17.5
resolution: "@0no-co/graphqlsp@npm:1.17.5"
dependencies:
"@gql.tada/internal": "npm:^1.2.1"
graphql: "npm:^15.5.0 || ^16.0.0 || ^17.0.0"
peerDependencies:
graphql: ^15.5.0 || ^16.0.0 || ^17.0.0
typescript: ^5.0.0 || ^6.0.0
checksum: 10c0/6b40d666ce9b237d0aebb13d17770c009e4416e8955c6636acaef49174b1bde5d612c7a6d7656a3053518cbbfbb85f9d039df78b595233c365878d2091987ed2
languageName: node
linkType: hard
"@babel/code-frame@npm:7.29.7, @babel/code-frame@npm:^7.29.7":
version: 7.29.7
resolution: "@babel/code-frame@npm:7.29.7"
@@ -313,52 +288,6 @@ __metadata:
languageName: node
linkType: hard
"@gql.tada/cli-utils@npm:1.7.3":
version: 1.7.3
resolution: "@gql.tada/cli-utils@npm:1.7.3"
dependencies:
"@0no-co/graphqlsp": "npm:^1.12.13"
"@gql.tada/internal": "npm:1.0.9"
graphql: "npm:^15.5.0 || ^16.0.0 || ^17.0.0"
peerDependencies:
"@0no-co/graphqlsp": ^1.12.13
"@gql.tada/svelte-support": 1.0.2
"@gql.tada/vue-support": 1.0.2
graphql: ^15.5.0 || ^16.0.0 || ^17.0.0
typescript: ^5.0.0 || ^6.0.0
peerDependenciesMeta:
"@gql.tada/svelte-support":
optional: true
"@gql.tada/vue-support":
optional: true
checksum: 10c0/55405687375cbda9a9e963fc627939a55c64e81816c8d6433add3564f2fc2c0600ec60c98e01de77fa21511713daf9e84b644362d9ce571f0ea5c43851c68b6f
languageName: node
linkType: hard
"@gql.tada/internal@npm:1.0.9":
version: 1.0.9
resolution: "@gql.tada/internal@npm:1.0.9"
dependencies:
"@0no-co/graphql.web": "npm:^1.0.5"
peerDependencies:
graphql: ^15.5.0 || ^16.0.0 || ^17.0.0
typescript: ^5.0.0 || ^6.0.0
checksum: 10c0/5599ab58bc5859bf9d38f13e4ca0aae564cf7e94fbfa9afdb9932d4719fb945cb19da917fe23ed0cf115550ce07d31bcac89c229385fe7077754b54c2bed16e9
languageName: node
linkType: hard
"@gql.tada/internal@npm:^1.2.1":
version: 1.2.2
resolution: "@gql.tada/internal@npm:1.2.2"
dependencies:
"@0no-co/graphql.web": "npm:^1.3.1"
peerDependencies:
graphql: ^15.5.0 || ^16.0.0 || ^17.0.0
typescript: ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0
checksum: 10c0/2861061a64fa88dbd8bac84cff87bc33a30e9ed971cbee9f8d9a52ec27a17ffc64c389fb6a75f2231458524556829b81f4744b55ccb433e46d28e1066a5d4655
languageName: node
linkType: hard
"@isaacs/fs-minipass@npm:^4.0.0":
version: 4.0.1
resolution: "@isaacs/fs-minipass@npm:4.0.1"
@@ -2010,25 +1939,6 @@ __metadata:
languageName: node
linkType: hard
"@shopify/hydrogen@npm:0.0.0-preview-116d5d7-20260730141607":
version: 0.0.0-preview-116d5d7-20260730141607
resolution: "@shopify/hydrogen@npm:0.0.0-preview-116d5d7-20260730141607"
dependencies:
gql.tada: "npm:1.9.2"
peerDependencies:
react: ^18.0.0 || ^19.0.0
vue: ^3.5.0
peerDependenciesMeta:
react:
optional: true
vue:
optional: true
bin:
hydrogen: bin/hydrogen.mjs
checksum: 10c0/b12e230d174a910d8abb7ab18ecb99357dce82d2125054b30af6dcbecf280c6fea40c8ca5fd67d8931e1079fd73e587e3ea1484f50c294f4a79ad714c9664ecd
languageName: node
linkType: hard
"@tailwindcss/node@npm:4.3.1":
version: 4.3.1
resolution: "@tailwindcss/node@npm:4.3.1"
@@ -2876,23 +2786,6 @@ __metadata:
languageName: node
linkType: hard
"gql.tada@npm:1.9.2":
version: 1.9.2
resolution: "gql.tada@npm:1.9.2"
dependencies:
"@0no-co/graphql.web": "npm:^1.0.5"
"@0no-co/graphqlsp": "npm:^1.12.13"
"@gql.tada/cli-utils": "npm:1.7.3"
"@gql.tada/internal": "npm:1.0.9"
peerDependencies:
typescript: ^5.0.0 || ^6.0.0
bin:
gql-tada: bin/cli.js
gql.tada: bin/cli.js
checksum: 10c0/e6995d5ddd41a0049f7e2494758d605567027c57b270e59c48355d7fbd0ca95db77db2385c14d2add1198ef59b91c1b5a7f9b70d9eac8668c2be534e55a56517
languageName: node
linkType: hard
"graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6":
version: 4.2.11
resolution: "graceful-fs@npm:4.2.11"
@@ -2900,13 +2793,6 @@ __metadata:
languageName: node
linkType: hard
"graphql@npm:^15.5.0 || ^16.0.0 || ^17.0.0, graphql@npm:^17.0.2":
version: 17.0.2
resolution: "graphql@npm:17.0.2"
checksum: 10c0/766546216b891439ed09fd8584963df2013e26f2f79f096036eaaa2788c38964e049c8a142d68e3afdabdd8bbe70042639e83f0f4b82edbc7c6850421f072bb6
languageName: node
linkType: hard
"h3-v2@npm:h3@2.0.1-rc.20":
version: 2.0.1-rc.20
resolution: "h3@npm:2.0.1-rc.20"
@@ -3923,7 +3809,6 @@ __metadata:
"@fontsource-variable/geist": "npm:^5.3.0"
"@fontsource-variable/geist-mono": "npm:^5.3.0"
"@remixicon/react": "npm:^4.9.0"
"@shopify/hydrogen": "npm:0.0.0-preview-116d5d7-20260730141607"
"@tailwindcss/vite": "npm:4.3.1"
"@tanstack/query-core": "npm:^5.104.1"
"@tanstack/react-query": "npm:^5.104.1"
@@ -3938,7 +3823,6 @@ __metadata:
clsx: "npm:^2.1.1"
cmdk: "npm:^1.1.1"
framer-motion: "npm:^12.42.2"
graphql: "npm:^17.0.2"
hono: "npm:^4.13.12"
lucide-react: "npm:^0.562.0"
radix-ui: "npm:^1.6.7"