Version: 2025-01
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query Markets { markets(first: 4) { nodes { name webPresence { rootUrls { locale url } } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query Markets {\n markets(first: 4) {\n nodes {\n name\n webPresence {\n rootUrls {\n locale\n url\n }\n }\n }\n }\n }`,\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query Markets {\n markets(first: 4) {\n nodes {\n name\n webPresence {\n rootUrls {\n locale\n url\n }\n }\n }\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query Markets {\n markets(first: 4) {\n nodes {\n name\n webPresence {\n rootUrls {\n locale\n url\n }\n }\n }\n }\n }\nQUERY;\n\n$response = $client->query([\"query\" => $query]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query Markets {\n markets(first: 4) {\n nodes {\n name\n webPresence {\n rootUrls {\n locale\n url\n }\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query Markets {\n markets(first: 4) {\n nodes {\n name\n webPresence {\n rootUrls {\n locale\n url\n }\n }\n }\n }\n}"
input: null
response: { "data": { "markets": { "nodes": [ { "name": "Canada", "webPresence": { "rootUrls": [ { "locale": "en", "url": "https://defaultglobal.com/en-ca" }, { "locale": "fr", "url": "https://defaultglobal.com/fr-ca" } ] } }, { "name": "European Union", "webPresence": { "rootUrls": [ { "locale": "en", "url": "https://defaultglobal.com/en-eu" }, { "locale": "es", "url": "https://defaultglobal.com/es-eu" }, { "locale": "fr", "url": "https://defaultglobal.com/fr-eu" } ] } }, { "name": "United Kingdom", "webPresence": { "rootUrls": [ { "locale": "en", "url": "https://uk.defaultglobal.com" } ] } }, { "name": "United States", "webPresence": { "rootUrls": [ { "locale": "en", "url": "https://defaultglobal.com" }, { "locale": "es", "url": "https://defaultglobal.com/es" } ] } } ] } } }
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query Markets { markets(first: 4) { nodes { id name regions(first: 2) { pageInfo { hasNextPage } nodes { name ... on MarketRegionCountry { code } } } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query Markets {\n markets(first: 4) {\n nodes {\n id\n name\n regions(first: 2) {\n pageInfo {\n hasNextPage\n }\n nodes {\n name\n ... on MarketRegionCountry {\n code\n }\n }\n }\n }\n }\n }`,\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query Markets {\n markets(first: 4) {\n nodes {\n id\n name\n regions(first: 2) {\n pageInfo {\n hasNextPage\n }\n nodes {\n name\n ... on MarketRegionCountry {\n code\n }\n }\n }\n }\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query Markets {\n markets(first: 4) {\n nodes {\n id\n name\n regions(first: 2) {\n pageInfo {\n hasNextPage\n }\n nodes {\n name\n ... on MarketRegionCountry {\n code\n }\n }\n }\n }\n }\n }\nQUERY;\n\n$response = $client->query([\"query\" => $query]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query Markets {\n markets(first: 4) {\n nodes {\n id\n name\n regions(first: 2) {\n pageInfo {\n hasNextPage\n }\n nodes {\n name\n ... on MarketRegionCountry {\n code\n }\n }\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query Markets {\n markets(first: 4) {\n nodes {\n id\n name\n regions(first: 2) {\n pageInfo {\n hasNextPage\n }\n nodes {\n name\n ... on MarketRegionCountry {\n code\n }\n }\n }\n }\n }\n}"
input: null
response: { "data": { "markets": { "nodes": [ { "id": "gid://shopify/Market/249692835", "name": "Canada", "regions": { "pageInfo": { "hasNextPage": false }, "nodes": [ { "name": "Canada", "code": "CA" } ] } }, { "id": "gid://shopify/Market/58345162", "name": "European Union", "regions": { "pageInfo": { "hasNextPage": true }, "nodes": [ { "name": "Germany", "code": "DE" }, { "name": "Belgium", "code": "BE" } ] } }, { "id": "gid://shopify/Market/867658238", "name": "United Kingdom", "regions": { "pageInfo": { "hasNextPage": false }, "nodes": [ { "name": "United Kingdom", "code": "GB" } ] } }, { "id": "gid://shopify/Market/371343838", "name": "United States", "regions": { "pageInfo": { "hasNextPage": false }, "nodes": [ { "name": "United States", "code": "US" } ] } } ] } } }