Version: unstable
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/unstable/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query CustomCollectionList { collections(first: 50, query: \\\"collection_type:custom\\\") { nodes { id handle title updatedAt descriptionHtml publishedOnCurrentPublication sortOrder templateSuffix } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query CustomCollectionList {\n collections(first: 50, query: \"collection_type:custom\") {\n nodes {\n id\n handle\n title\n updatedAt\n descriptionHtml\n publishedOnCurrentPublication\n sortOrder\n templateSuffix\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 CustomCollectionList {\n collections(first: 50, query: \"collection_type:custom\") {\n nodes {\n id\n handle\n title\n updatedAt\n descriptionHtml\n publishedOnCurrentPublication\n sortOrder\n templateSuffix\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 CustomCollectionList {\n collections(first: 50, query: \"collection_type:custom\") {\n nodes {\n id\n handle\n title\n updatedAt\n descriptionHtml\n publishedOnCurrentPublication\n sortOrder\n templateSuffix\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 CustomCollectionList {\n collections(first: 50, query: \"collection_type:custom\") {\n nodes {\n id\n handle\n title\n updatedAt\n descriptionHtml\n publishedOnCurrentPublication\n sortOrder\n templateSuffix\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query CustomCollectionList {\n collections(first: 50, query: \"collection_type:custom\") {\n nodes {\n id\n handle\n title\n updatedAt\n descriptionHtml\n publishedOnCurrentPublication\n sortOrder\n templateSuffix\n }\n }\n}"
input: null
response: { "data": { "collections": { "nodes": [ { "id": "gid://shopify/Collection/395646240", "handle": "ipods_two", "title": "IPods Two", "updatedAt": "2008-02-02T00:00:00Z", "descriptionHtml": "<p>The best selling ipod ever. Again</p>", "publishedOnCurrentPublication": true, "sortOrder": "MANUAL", "templateSuffix": null }, { "id": "gid://shopify/Collection/691652237", "handle": "non-ipods", "title": "Non Ipods", "updatedAt": "2013-02-02T00:00:00Z", "descriptionHtml": "<p>No ipods here</p>", "publishedOnCurrentPublication": true, "sortOrder": "MANUAL", "templateSuffix": null }, { "id": "gid://shopify/Collection/841564295", "handle": "ipods", "title": "IPods", "updatedAt": "2008-02-02T00:00:00Z", "descriptionHtml": "<p>The best selling ipod ever</p>", "publishedOnCurrentPublication": true, "sortOrder": "MANUAL", "templateSuffix": null } ] } } }
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/unstable/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { collections(first: 5) { edges { node { id title handle updatedAt sortOrder } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n collections(first: 5) {\n edges {\n node {\n id\n title\n handle\n updatedAt\n sortOrder\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 collections(first: 5) {\n edges {\n node {\n id\n title\n handle\n updatedAt\n sortOrder\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 {\n collections(first: 5) {\n edges {\n node {\n id\n title\n handle\n updatedAt\n sortOrder\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 {\n collections(first: 5) {\n edges {\n node {\n id\n title\n handle\n updatedAt\n sortOrder\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n collections(first: 5) {\n edges {\n node {\n id\n title\n handle\n updatedAt\n sortOrder\n }\n }\n }\n}"
input: null
response: { "data": { "collections": { "edges": [ { "node": { "id": "gid://shopify/Collection/79210309", "title": "Custom Other Items", "handle": "reorder_custom", "updatedAt": "2008-10-10T00:00:00Z", "sortOrder": "MANUAL" } }, { "node": { "id": "gid://shopify/Collection/94229130", "title": "All products more expensive than free", "handle": "everything", "updatedAt": "2006-02-02T00:00:00Z", "sortOrder": "MANUAL" } }, { "node": { "id": "gid://shopify/Collection/142458073", "title": "All snowboards", "handle": "snowboards", "updatedAt": "2006-02-02T00:00:00Z", "sortOrder": "MANUAL" } }, { "node": { "id": "gid://shopify/Collection/411960790", "title": "Bold snowboards", "handle": "bold", "updatedAt": "2006-02-02T00:00:00Z", "sortOrder": "MANUAL" } }, { "node": { "id": "gid://shopify/Collection/431528632", "title": "All arbor products tagged deepsnow", "handle": "all-arbor-products-tagged-deepsnow", "updatedAt": "2006-02-02T00:00:00Z", "sortOrder": "MANUAL" } } ] } } }
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/unstable/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { collections(first: 5, query: \\\"collection_type:smart\\\", sortKey: UPDATED_AT, reverse: true) { edges { node { id title handle updatedAt sortOrder } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n collections(first: 5, query: \"collection_type:smart\", sortKey: UPDATED_AT, reverse: true) {\n edges {\n node {\n id\n title\n handle\n updatedAt\n sortOrder\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 collections(first: 5, query: \"collection_type:smart\", sortKey: UPDATED_AT, reverse: true) {\n edges {\n node {\n id\n title\n handle\n updatedAt\n sortOrder\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 {\n collections(first: 5, query: \"collection_type:smart\", sortKey: UPDATED_AT, reverse: true) {\n edges {\n node {\n id\n title\n handle\n updatedAt\n sortOrder\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 {\n collections(first: 5, query: \"collection_type:smart\", sortKey: UPDATED_AT, reverse: true) {\n edges {\n node {\n id\n title\n handle\n updatedAt\n sortOrder\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n collections(first: 5, query: \"collection_type:smart\", sortKey: UPDATED_AT, reverse: true) {\n edges {\n node {\n id\n title\n handle\n updatedAt\n sortOrder\n }\n }\n }\n}"
input: null
response: { "data": { "collections": { "edges": [ { "node": { "id": "gid://shopify/Collection/522532842", "title": "Frisbees", "handle": "reorder_smart_frisbees", "updatedAt": "2008-10-12T00:00:00Z", "sortOrder": "MANUAL" } }, { "node": { "id": "gid://shopify/Collection/1063001310", "title": "Smart Other items", "handle": "reorder_smart", "updatedAt": "2008-10-11T00:00:00Z", "sortOrder": "MANUAL" } }, { "node": { "id": "gid://shopify/Collection/1009501285", "title": "Dummy", "handle": "blank", "updatedAt": "2006-02-02T00:00:00Z", "sortOrder": "MANUAL" } }, { "node": { "id": "gid://shopify/Collection/925420914", "title": "All snowboards called Draft", "handle": "drafts", "updatedAt": "2006-02-02T00:00:00Z", "sortOrder": "MANUAL" } }, { "node": { "id": "gid://shopify/Collection/619119800", "title": "Cheap Stuff", "handle": "cheap", "updatedAt": "2006-02-02T00:00:00Z", "sortOrder": "MANUAL" } } ] } } }
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/unstable/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query CustomCollectionList { collections(first: 50, query: \\\"collection_type:custom\\\") { nodes { id handle title updatedAt descriptionHtml publishedOnCurrentPublication sortOrder templateSuffix } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query CustomCollectionList {\n collections(first: 50, query: \"collection_type:custom\") {\n nodes {\n id\n handle\n title\n updatedAt\n descriptionHtml\n publishedOnCurrentPublication\n sortOrder\n templateSuffix\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 CustomCollectionList {\n collections(first: 50, query: \"collection_type:custom\") {\n nodes {\n id\n handle\n title\n updatedAt\n descriptionHtml\n publishedOnCurrentPublication\n sortOrder\n templateSuffix\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 CustomCollectionList {\n collections(first: 50, query: \"collection_type:custom\") {\n nodes {\n id\n handle\n title\n updatedAt\n descriptionHtml\n publishedOnCurrentPublication\n sortOrder\n templateSuffix\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 CustomCollectionList {\n collections(first: 50, query: \"collection_type:custom\") {\n nodes {\n id\n handle\n title\n updatedAt\n descriptionHtml\n publishedOnCurrentPublication\n sortOrder\n templateSuffix\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query CustomCollectionList {\n collections(first: 50, query: \"collection_type:custom\") {\n nodes {\n id\n handle\n title\n updatedAt\n descriptionHtml\n publishedOnCurrentPublication\n sortOrder\n templateSuffix\n }\n }\n}"
input: null
response: { "data": { "collections": { "nodes": [ { "id": "gid://shopify/Collection/395646240", "handle": "ipods_two", "title": "IPods Two", "updatedAt": "2008-02-02T00:00:00Z", "descriptionHtml": "<p>The best selling ipod ever. Again</p>", "publishedOnCurrentPublication": true, "sortOrder": "MANUAL", "templateSuffix": null }, { "id": "gid://shopify/Collection/691652237", "handle": "non-ipods", "title": "Non Ipods", "updatedAt": "2013-02-02T00:00:00Z", "descriptionHtml": "<p>No ipods here</p>", "publishedOnCurrentPublication": true, "sortOrder": "MANUAL", "templateSuffix": null }, { "id": "gid://shopify/Collection/841564295", "handle": "ipods", "title": "IPods", "updatedAt": "2008-02-02T00:00:00Z", "descriptionHtml": "<p>The best selling ipod ever</p>", "publishedOnCurrentPublication": true, "sortOrder": "MANUAL", "templateSuffix": null } ] } } }
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/unstable/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query SmartCollectionList { collections(first: 50, query: \\\"collection_type:smart\\\") { nodes { id handle title updatedAt descriptionHtml publishedOnCurrentPublication sortOrder templateSuffix ruleSet { appliedDisjunctively rules { column relation condition conditionObject { ... on CollectionRuleMetafieldCondition { metafieldConditionDisplayName metafieldDefinition { id } } ... on CollectionRuleProductCategoryCondition { value { id } } ... on CollectionRuleTextCondition { value } } } } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query SmartCollectionList {\n collections(first: 50, query: \"collection_type:smart\") {\n nodes {\n id\n handle\n title\n updatedAt\n descriptionHtml\n publishedOnCurrentPublication\n sortOrder\n templateSuffix\n ruleSet {\n appliedDisjunctively\n rules {\n column\n relation\n condition\n conditionObject {\n ... on CollectionRuleMetafieldCondition {\n metafieldConditionDisplayName\n metafieldDefinition {\n id\n }\n }\n ... on CollectionRuleProductCategoryCondition {\n value {\n id\n }\n }\n ... on CollectionRuleTextCondition {\n value\n }\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 SmartCollectionList {\n collections(first: 50, query: \"collection_type:smart\") {\n nodes {\n id\n handle\n title\n updatedAt\n descriptionHtml\n publishedOnCurrentPublication\n sortOrder\n templateSuffix\n ruleSet {\n appliedDisjunctively\n rules {\n column\n relation\n condition\n conditionObject {\n ... on CollectionRuleMetafieldCondition {\n metafieldConditionDisplayName\n metafieldDefinition {\n id\n }\n }\n ... on CollectionRuleProductCategoryCondition {\n value {\n id\n }\n }\n ... on CollectionRuleTextCondition {\n value\n }\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 SmartCollectionList {\n collections(first: 50, query: \"collection_type:smart\") {\n nodes {\n id\n handle\n title\n updatedAt\n descriptionHtml\n publishedOnCurrentPublication\n sortOrder\n templateSuffix\n ruleSet {\n appliedDisjunctively\n rules {\n column\n relation\n condition\n conditionObject {\n ... on CollectionRuleMetafieldCondition {\n metafieldConditionDisplayName\n metafieldDefinition {\n id\n }\n }\n ... on CollectionRuleProductCategoryCondition {\n value {\n id\n }\n }\n ... on CollectionRuleTextCondition {\n value\n }\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 SmartCollectionList {\n collections(first: 50, query: \"collection_type:smart\") {\n nodes {\n id\n handle\n title\n updatedAt\n descriptionHtml\n publishedOnCurrentPublication\n sortOrder\n templateSuffix\n ruleSet {\n appliedDisjunctively\n rules {\n column\n relation\n condition\n conditionObject {\n ... on CollectionRuleMetafieldCondition {\n metafieldConditionDisplayName\n metafieldDefinition {\n id\n }\n }\n ... on CollectionRuleProductCategoryCondition {\n value {\n id\n }\n }\n ... on CollectionRuleTextCondition {\n value\n }\n }\n }\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query SmartCollectionList {\n collections(first: 50, query: \"collection_type:smart\") {\n nodes {\n id\n handle\n title\n updatedAt\n descriptionHtml\n publishedOnCurrentPublication\n sortOrder\n templateSuffix\n ruleSet {\n appliedDisjunctively\n rules {\n column\n relation\n condition\n conditionObject {\n ... on CollectionRuleMetafieldCondition {\n metafieldConditionDisplayName\n metafieldDefinition {\n id\n }\n }\n ... on CollectionRuleProductCategoryCondition {\n value {\n id\n }\n }\n ... on CollectionRuleTextCondition {\n value\n }\n }\n }\n }\n }\n }\n}"
input: null
response: { "data": { "collections": { "nodes": [ { "id": "gid://shopify/Collection/482865238", "handle": "smart-ipods", "title": "Smart iPods", "updatedAt": "2008-02-02T00:00:00Z", "descriptionHtml": "<p>The best selling ipod ever</p>", "publishedOnCurrentPublication": true, "sortOrder": "MANUAL", "templateSuffix": null, "ruleSet": { "appliedDisjunctively": false, "rules": [ { "column": "TYPE", "relation": "EQUALS", "condition": "Cult Products", "conditionObject": { "value": "Cult Products" } } ] } } ] } } }