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 BlogList { blogs(first: 50) { nodes { id handle title updatedAt commentPolicy feed { path location } createdAt templateSuffix tags } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query BlogList {\n blogs(first: 50) {\n nodes {\n id\n handle\n title\n updatedAt\n commentPolicy\n feed {\n path\n location\n }\n createdAt\n templateSuffix\n tags\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 BlogList {\n blogs(first: 50) {\n nodes {\n id\n handle\n title\n updatedAt\n commentPolicy\n feed {\n path\n location\n }\n createdAt\n templateSuffix\n tags\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 BlogList {\n blogs(first: 50) {\n nodes {\n id\n handle\n title\n updatedAt\n commentPolicy\n feed {\n path\n location\n }\n createdAt\n templateSuffix\n tags\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 BlogList {\n blogs(first: 50) {\n nodes {\n id\n handle\n title\n updatedAt\n commentPolicy\n feed {\n path\n location\n }\n createdAt\n templateSuffix\n tags\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query BlogList {\n blogs(first: 50) {\n nodes {\n id\n handle\n title\n updatedAt\n commentPolicy\n feed {\n path\n location\n }\n createdAt\n templateSuffix\n tags\n }\n }\n}"
input: null
response: { "data": { "blogs": { "nodes": [ { "id": "gid://shopify/Blog/389767568", "handle": "bluecheese-blog", "title": "The Blog", "updatedAt": "2024-02-02T00:00:00Z", "commentPolicy": "CLOSED", "feed": null, "createdAt": "2023-02-01T00:00:00Z", "templateSuffix": null, "tags": [] }, { "id": "gid://shopify/Blog/397675442", "handle": "smallcheese-blog", "title": "Yo Blog", "updatedAt": "2011-11-02T00:00:00Z", "commentPolicy": "CLOSED", "feed": null, "createdAt": "2024-10-29T22:38:08Z", "templateSuffix": null, "tags": [ "not_alpha" ] }, { "id": "gid://shopify/Blog/854997985", "handle": "bigcheese-blog", "title": "Mah Blog", "updatedAt": "2006-02-02T00:00:00Z", "commentPolicy": "CLOSED", "feed": null, "createdAt": "2006-02-01T00:00:00Z", "templateSuffix": null, "tags": [ "alpha", "important" ] } ] } } }