marketsquery
Requires read
for queries and both read
as well as write
for mutations.
The markets configured for the shop.
MarketConnection argumentsMarketConnection!
The elements that come after the specified cursor.
Anchor to beforebeforeThe elements that come before the specified cursor.
Anchor to firstfirstThe first
n
elements from the paginated list.The last
n
elements from the paginated list.Reverse the order of the underlying list.
MarketConnection possible returns
The connection between the node and its parent. Each edge contains a minimum of the edge's cursor and the node.
A list of nodes that are contained in MarketEdge. You can fetch data about an individual node, or you can follow the edges to fetch data about a collection of related nodes. At each node, you specify the fields that you want to retrieve.
An object that’s used to retrieve cursor information about the current page.
Code examples for QUERY: markets
Query Reference for QUERY: markets
"{\n markets {\n # MarketConnection fields\n }\n}"
Input Reference for QUERY: markets
Schema Reference for QUERY: markets
Display Examples for QUERY: markets
[ { "example": { "type_name": "markets", "title": "Get market web presences and their root URLs", "description": "The following query loads the web presences configured for a shop’s markets and the language-specific root URLs available on each.", "query_string": "query Markets {\n markets(first: 4) {\n nodes {\n name\n webPresence {\n rootUrls {\n locale\n url\n }\n }\n }\n }\n}", "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" } ] } } ] } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/markets/test/unit/graph_api/admin/market_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/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", "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", "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", "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", "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" }, "titleStringKey": "arguments", "inputVariableEntries": [] }, { "example": { "type_name": "markets", "title": "Get the first four markets", "description": "The following query retrieves the first four markets, their names, and what regions are included in them.", "query_string": "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}", "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" } ] } } ] } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/markets/test/unit/graph_api/admin/market_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/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", "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", "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", "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", "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" }, "titleStringKey": "arguments", "inputVariableEntries": [] } ]