From 27215cb4aa7d36fc133ecd1069ccd6acafcbfb16 Mon Sep 17 00:00:00 2001 From: Andrea Date: Mon, 30 Dec 2024 09:36:03 +0100 Subject: [PATCH] woops --- content/run_shopify_app_without_appbridge.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/run_shopify_app_without_appbridge.md b/content/run_shopify_app_without_appbridge.md index a919892..4d4357e 100644 --- a/content/run_shopify_app_without_appbridge.md +++ b/content/run_shopify_app_without_appbridge.md @@ -108,7 +108,7 @@ Do you see the point here? We actually do not need the session if we already hav Let's write now some logic to handle this, we want to run our app with a `shopifyDomain` we define, something like: -```typescript +```ts export async function requireShopifyDomain(request: Request) { if(process.env.NODE_ENV === "development" && process.env.RUN_AS_SHOPIFY_DOMAIN) { const shopifyDomain = process.env.RUN_AS_SHOPIFY_DOMAIN; @@ -124,7 +124,7 @@ Excellent, we can retrieve now the `shopifyDomain` we define as an env, just in Let's write now a simple utility to handle all loaders requests in the same way: -```typescript +```ts export function handleLoaderRequest( request: Request, callback: (shopifyDomain: string) => Promise @@ -163,7 +163,7 @@ export async function findShop(shopifyDomain: string) { After this let's set up the GraphQL schema for Genql, simply run the following command: ```bash -npx genql --endpoint "https://.myshopify.com/admin/api/2024-07/graphql.json" -S --output "app/lib/genql/generated.server" -H "X-Shopify-Access-Token: " --esm +npx genql --endpoint "https://.myshopify.com/admin/api/2024-07/graphql.json" -S --output "app/lib/genql/generated.server" -H "X-Shopify-Access-Token: " --esm ``` Replace the `.myshopify.com` and `` with some real data (you can also use the data from a test store, the command is just needed to generate the graphql schema).