Skip to content

Commit 74c4b99

Browse files
guitavanoclaude
andauthored
feat(wake): use checkoutUrl as GraphQL storefront endpoint (#1653)
* feat(wake): use checkoutUrl as GraphQL storefront endpoint Point the Storefront GraphQL client to ${checkoutUrl}/graphql instead of the hardcoded https://storefront-api.fbits.net/graphql. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(wake): normalize storefront GraphQL endpoint and add fallback Address cubic review: use new URL("/graphql", ...) to avoid a double-slash when checkoutUrl has a trailing slash, and fall back to https://${account}.checkout.fbits.store when checkoutUrl is empty, matching the checkoutApi client. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(wake): fall back to storefront-api.fbits.net for GraphQL endpoint Preserve the previous default host when checkoutUrl is empty instead of pointing at the checkout store. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 7ddbf13 commit 74c4b99

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

wake/mod.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@ For help: https://wakecommerce.readme.io/docs/storefront-api-criacao-e-autentica
109109
});
110110
//22e714b360b7ef187fe4bdb93385dd0a85686e2a
111111
const storefront = createGraphqlClient({
112-
endpoint: "https://storefront-api.fbits.net/graphql",
112+
endpoint: new URL(
113+
"/graphql",
114+
checkoutUrl ?? "https://storefront-api.fbits.net",
115+
).href,
113116
headers: new Headers({ "TCS-Access-Token": `${stringStorefrontToken}` }),
114117
fetcher: fetchSafe,
115118
});

0 commit comments

Comments
 (0)