Version: 2024-10
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 { themes(first: 1) { edges { node { name id role } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n themes(first: 1) {\n edges {\n node {\n name\n id\n role\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 {\n themes(first: 1) {\n edges {\n node {\n name\n id\n role\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([\"query\" => $query]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n themes(first: 1) {\n edges {\n node {\n name\n id\n role\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n themes(first: 1) {\n edges {\n node {\n name\n id\n role\n }\n }\n }\n}"
input: null
response: { "data": { "themes": { "edges": [ { "node": { "name": "main", "id": "gid://shopify/OnlineStoreTheme/672824141", "role": "MAIN" } } ] } } }
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 { themes(first: 10, names: [\\\"Com*\\\", \\\"Development\\\"]) { nodes { id name role } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n themes(first: 10, names: [\"Com*\", \"Development\"]) {\n nodes {\n id\n name\n role\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 {\n themes(first: 10, names: [\"Com*\", \"Development\"]) {\n nodes {\n id\n name\n role\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([\"query\" => $query]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n themes(first: 10, names: [\"Com*\", \"Development\"]) {\n nodes {\n id\n name\n role\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n themes(first: 10, names: [\"Com*\", \"Development\"]) {\n nodes {\n id\n name\n role\n }\n }\n}"
input: null
response: { "data": { "themes": { "nodes": [ { "id": "gid://shopify/OnlineStoreTheme/225007463", "name": "Comfort", "role": "UNPUBLISHED" }, { "id": "gid://shopify/OnlineStoreTheme/273775728", "name": "Development", "role": "DEVELOPMENT" }, { "id": "gid://shopify/OnlineStoreTheme/529529152", "name": "Comfort", "role": "MAIN" }, { "id": "gid://shopify/OnlineStoreTheme/756912091", "name": "Comfort Copy", "role": "UNPUBLISHED" } ] } } }
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 ThemeList { themes(first: 10) { edges { node { createdAt id name prefix processing processingFailed role themeStoreId updatedAt } cursor } pageInfo { hasNextPage hasPreviousPage } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query ThemeList {\n themes(first: 10) {\n edges {\n node {\n createdAt\n id\n name\n prefix\n processing\n processingFailed\n role\n themeStoreId\n updatedAt\n }\n cursor\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\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 ThemeList {\n themes(first: 10) {\n edges {\n node {\n createdAt\n id\n name\n prefix\n processing\n processingFailed\n role\n themeStoreId\n updatedAt\n }\n cursor\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\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([\"query\" => $query]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query ThemeList {\n themes(first: 10) {\n edges {\n node {\n createdAt\n id\n name\n prefix\n processing\n processingFailed\n role\n themeStoreId\n updatedAt\n }\n cursor\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query ThemeList {\n themes(first: 10) {\n edges {\n node {\n createdAt\n id\n name\n prefix\n processing\n processingFailed\n role\n themeStoreId\n updatedAt\n }\n cursor\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n }\n}"
input: null
response: { "data": { "themes": { "edges": [ { "node": { "createdAt": "2024-10-30T22:18:09Z", "id": "gid://shopify/OnlineStoreTheme/69265273", "name": "Blockified", "prefix": "/t/5", "processing": false, "processingFailed": false, "role": "UNPUBLISHED", "themeStoreId": null, "updatedAt": "2024-10-30T22:18:09Z" }, "cursor": "eyJsYXN0X2lkIjo2OTI2NTI3MywibGFzdF92YWx1ZSI6NjkyNjUyNzN9" }, { "node": { "createdAt": "2024-10-30T22:18:09Z", "id": "gid://shopify/OnlineStoreTheme/225007463", "name": "Comfort", "prefix": "/t/10", "processing": false, "processingFailed": false, "role": "UNPUBLISHED", "themeStoreId": 1234, "updatedAt": "2024-10-30T22:18:09Z" }, "cursor": "eyJsYXN0X2lkIjoyMjUwMDc0NjMsImxhc3RfdmFsdWUiOjIyNTAwNzQ2M30=" }, { "node": { "createdAt": "2024-10-30T22:18:09Z", "id": "gid://shopify/OnlineStoreTheme/273775728", "name": "Development", "prefix": "/t/8", "processing": false, "processingFailed": false, "role": "DEVELOPMENT", "themeStoreId": null, "updatedAt": "2024-10-30T22:18:09Z" }, "cursor": "eyJsYXN0X2lkIjoyNzM3NzU3MjgsImxhc3RfdmFsdWUiOjI3Mzc3NTcyOH0=" }, { "node": { "createdAt": "2024-10-30T22:18:09Z", "id": "gid://shopify/OnlineStoreTheme/486964194", "name": "Legacy", "prefix": "/t/4", "processing": false, "processingFailed": false, "role": "UNPUBLISHED", "themeStoreId": 12, "updatedAt": "2024-10-30T22:18:09Z" }, "cursor": "eyJsYXN0X2lkIjo0ODY5NjQxOTQsImxhc3RfdmFsdWUiOjQ4Njk2NDE5NH0=" }, { "node": { "createdAt": "2024-10-30T22:18:09Z", "id": "gid://shopify/OnlineStoreTheme/529529152", "name": "Comfort", "prefix": "/t/1", "processing": false, "processingFailed": false, "role": "MAIN", "themeStoreId": 1234, "updatedAt": "2024-10-30T22:18:09Z" }, "cursor": "eyJsYXN0X2lkIjo1Mjk1MjkxNTIsImxhc3RfdmFsdWUiOjUyOTUyOTE1Mn0=" }, { "node": { "createdAt": "2024-10-30T22:18:09Z", "id": "gid://shopify/OnlineStoreTheme/535899345", "name": "Internationalized", "prefix": "/t/6", "processing": false, "processingFailed": false, "role": "UNPUBLISHED", "themeStoreId": null, "updatedAt": "2024-10-30T22:18:09Z" }, "cursor": "eyJsYXN0X2lkIjo1MzU4OTkzNDUsImxhc3RfdmFsdWUiOjUzNTg5OTM0NX0=" }, { "node": { "createdAt": "2024-10-30T22:18:09Z", "id": "gid://shopify/OnlineStoreTheme/756912091", "name": "Comfort Copy", "prefix": "/t/9", "processing": false, "processingFailed": false, "role": "UNPUBLISHED", "themeStoreId": 12345, "updatedAt": "2024-10-30T22:18:09Z" }, "cursor": "eyJsYXN0X2lkIjo3NTY5MTIwOTEsImxhc3RfdmFsdWUiOjc1NjkxMjA5MX0=" }, { "node": { "createdAt": "2024-10-30T22:18:09Z", "id": "gid://shopify/OnlineStoreTheme/908009861", "name": "Sandbox", "prefix": "/t/3", "processing": false, "processingFailed": false, "role": "UNPUBLISHED", "themeStoreId": 1234, "updatedAt": "2024-10-30T22:18:09Z" }, "cursor": "eyJsYXN0X2lkIjo5MDgwMDk4NjEsImxhc3RfdmFsdWUiOjkwODAwOTg2MX0=" }, { "node": { "createdAt": "2024-10-30T22:18:09Z", "id": "gid://shopify/OnlineStoreTheme/918442480", "name": "Speed", "prefix": "/t/2", "processing": false, "processingFailed": false, "role": "MOBILE", "themeStoreId": null, "updatedAt": "2024-10-30T22:18:09Z" }, "cursor": "eyJsYXN0X2lkIjo5MTg0NDI0ODAsImxhc3RfdmFsdWUiOjkxODQ0MjQ4MH0=" } ], "pageInfo": { "hasNextPage": false, "hasPreviousPage": false } } } }