# themes - admin-graphql - QUERY Version: 2024-10 ## Description Returns a paginated list of themes for the shop. ### Access Scopes `read_themes` access scope. ## Arguments * [after](/docs/api/admin-graphql/2024-10/scalars/String): String - The elements that come after the specified [cursor](https://shopify.dev/api/usage/pagination-graphql). * [before](/docs/api/admin-graphql/2024-10/scalars/String): String - The elements that come before the specified [cursor](https://shopify.dev/api/usage/pagination-graphql). * [first](/docs/api/admin-graphql/2024-10/scalars/Int): Int - The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql). * [last](/docs/api/admin-graphql/2024-10/scalars/Int): Int - The last `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql). * [names](/docs/api/admin-graphql/2024-10/scalars/String): String - The theme names to filter by. Use '*' to match zero or more characters. * [reverse](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean - Reverse the order of the underlying list. * [roles](/docs/api/admin-graphql/2024-10/enums/ThemeRole): ThemeRole - The theme roles to filter by. ## Returns * [edges](/docs/api/admin-graphql/2024-10/objects/OnlineStoreThemeEdge): OnlineStoreThemeEdge! The connection between the node and its parent. Each edge contains a minimum of the edge's cursor and the node. * [nodes](/docs/api/admin-graphql/2024-10/objects/OnlineStoreTheme): OnlineStoreTheme! A list of nodes that are contained in OnlineStoreThemeEdge. 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. * [pageInfo](/docs/api/admin-graphql/2024-10/objects/PageInfo): PageInfo! An object that’s used to retrieve [cursor information](https://shopify.dev/api/usage/pagination-graphql) about the current page. ## Examples ### Get first theme 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" 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}" #### Graphql Input null #### Graphql Response { "data": { "themes": { "edges": [ { "node": { "name": "main", "id": "gid://shopify/OnlineStoreTheme/672824141", "role": "MAIN" } } ] } } } ### Get themes by name 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" 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}" #### Graphql Input null #### Graphql 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" } ] } } } ### Retrieves a list of themes 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" 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}" #### Graphql Input null #### Graphql 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 } } } }