Getting Undefined for shop domain in graphql endpoint on Safari Browser

Topic summary

  • Problem: Storefront GraphQL calls fail only in Safari, with the shop domain resolving to “undefined.” The network panel shows requests going to https://undefined/api/2024-04/graphql.json, even when the shop is hardcoded.

  • Context: Used inside an embedded Shopify app to fetch collections, products, and pages. Endpoint format: https://${shop}/api/2024-04/graphql.json. Shop domain and Storefront access token were double‑checked as correct, and it works on Chrome and Edge.

  • Reproduction: A request was made for a reproducible case; a development store URL (https://grace121.myshopify.com) was provided.

  • Proposed cause: One participant suggested Safari-specific behavior around cookies or caching could be interfering.

  • Status and next steps: No confirmed fix yet. Discussion remains open; further replication and debugging on Safari are needed, particularly how the shop variable is derived in that browser and whether cookie/cache policies affect it.

Summarized with AI on December 20. AI used: gpt-5.

Hi Community, I am using Shopify Storefront Graphql API to get the store data. It’s working fine on other browsers but for some reasons Its not working on Safari browser and getting the shop domain undefined.
I have confirmed that the shop domain and storefront access token both are correct.

this is how i am accessing it https://${shop}/api/2024-04/graphql.json
on safari i get this on my network tab [https://undefined](https://undefined)/api/2024-04/graphql.json
I have also hardcoded the shop but still getting the same.

Hello @amjad-ali-afrid

Could you please share the store URL and some details to replicate this issue?

This is the one store URL among the multiple development stores i am using for testing “https://grace121.myshopify.com/”. I use the graphql api to get the data like collections, products and pages of the store on which I install my embedded Shopify App. everything is fine on chrome, edge but getting undefined on safari

The issue of receiving “Undefined for shop domain” in the GraphQL endpoint on Safari Browser may be due to browser-specific handling of cookies or caching.

“Empowering you with motivational, inspirational, and positive thoughts to fuel your journey.”