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).