Version: 2024-04
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-04/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { orders(first: 10, query: \\\"updated_at:>2019-12-01\\\") { edges { node { id updatedAt } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n orders(first: 10, query: \"updated_at:>2019-12-01\") {\n edges {\n node {\n id\n updatedAt\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 orders(first: 10, query: \"updated_at:>2019-12-01\") {\n edges {\n node {\n id\n updatedAt\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 = <<2019-12-01\") {\n edges {\n node {\n id\n updatedAt\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 orders(first: 10, query: \"updated_at:>2019-12-01\") {\n edges {\n node {\n id\n updatedAt\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n orders(first: 10, query: \"updated_at:>2019-12-01\") {\n edges {\n node {\n id\n updatedAt\n }\n }\n }\n}"
input: null
response: { "data": { "orders": { "edges": [ { "node": { "id": "gid://shopify/Order/158040885", "updatedAt": "2021-12-01T12:34:43Z" } }, { "node": { "id": "gid://shopify/Order/199007853", "updatedAt": "2021-12-01T12:34:43Z" } }, { "node": { "id": "gid://shopify/Order/212949620", "updatedAt": "2021-12-01T12:34:43Z" } }, { "node": { "id": "gid://shopify/Order/294238686", "updatedAt": "2021-12-01T12:34:43Z" } }, { "node": { "id": "gid://shopify/Order/316002265", "updatedAt": "2021-12-01T12:34:43Z" } }, { "node": { "id": "gid://shopify/Order/459506686", "updatedAt": "2021-12-01T12:34:43Z" } }, { "node": { "id": "gid://shopify/Order/634584900", "updatedAt": "2021-12-01T12:34:43Z" } }, { "node": { "id": "gid://shopify/Order/744797037", "updatedAt": "2021-12-01T12:34:43Z" } }, { "node": { "id": "gid://shopify/Order/1001810659", "updatedAt": "2021-12-01T12:34:43Z" } }, { "node": { "id": "gid://shopify/Order/1021030140", "updatedAt": "2021-12-01T12:34:43Z" } } ] } } }
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-04/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { orders(first: 10, query: \\\"financial_status:authorized\\\") { edges { node { id displayFinancialStatus } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n orders(first: 10, query: \"financial_status:authorized\") {\n edges {\n node {\n id\n displayFinancialStatus\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 orders(first: 10, query: \"financial_status:authorized\") {\n edges {\n node {\n id\n displayFinancialStatus\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 orders(first: 10, query: \"financial_status:authorized\") {\n edges {\n node {\n id\n displayFinancialStatus\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n orders(first: 10, query: \"financial_status:authorized\") {\n edges {\n node {\n id\n displayFinancialStatus\n }\n }\n }\n}"
input: null
response: { "data": { "orders": { "edges": [ { "node": { "id": "gid://shopify/Order/471861129", "displayFinancialStatus": "AUTHORIZED" } }, { "node": { "id": "gid://shopify/Order/527229289", "displayFinancialStatus": "AUTHORIZED" } }, { "node": { "id": "gid://shopify/Order/751082136", "displayFinancialStatus": "AUTHORIZED" } }, { "node": { "id": "gid://shopify/Order/431501862", "displayFinancialStatus": "AUTHORIZED" } } ] } } }
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-04/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { orders(first: 10) { edges { node { id } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n orders(first: 10) {\n edges {\n node {\n id\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 orders(first: 10) {\n edges {\n node {\n id\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 orders(first: 10) {\n edges {\n node {\n id\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n orders(first: 10) {\n edges {\n node {\n id\n }\n }\n }\n}"
input: null
response: { "data": { "orders": { "edges": [ { "node": { "id": "gid://shopify/Order/126216516" } }, { "node": { "id": "gid://shopify/Order/148977776" } }, { "node": { "id": "gid://shopify/Order/235240302" } }, { "node": { "id": "gid://shopify/Order/357944854" } }, { "node": { "id": "gid://shopify/Order/404481575" } }, { "node": { "id": "gid://shopify/Order/409214363" } }, { "node": { "id": "gid://shopify/Order/471861129" } }, { "node": { "id": "gid://shopify/Order/480796189" } }, { "node": { "id": "gid://shopify/Order/527229289" } }, { "node": { "id": "gid://shopify/Order/556527638" } } ] } } }