draft Ordersquery
List of saved draft orders.
DraftOrderConnection argumentsDraftOrderConnection!
The elements that come after the specified cursor.
Anchor to beforebeforeThe elements that come before the specified cursor.
Anchor to firstfirstThe first
n
elements from the paginated list.The last
n
elements from the paginated list.A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about Shopify API search syntax.
Reverse the order of the underlying list.
Anchor to savedSearchIdsavedSearchIdThe ID of a saved search. The search’s query string is used as the query argument.
Sort the underlying list using a key. If your query is slow or returns an error, then try specifying a sort key that matches the field used in the search.
DraftOrderConnection possible returns
The connection between the node and its parent. Each edge contains a minimum of the edge's cursor and the node.
A list of nodes that are contained in DraftOrderEdge. 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.
An object that’s used to retrieve cursor information about the current page.
Code examples for QUERY: draftOrders
Query Reference for QUERY: draftOrders
"{\n draftOrders {\n # DraftOrderConnection fields\n }\n}"
Input Reference for QUERY: draftOrders
Schema Reference for QUERY: draftOrders
Display Examples for QUERY: draftOrders
[ { "example": { "type_name": "draftorders", "title": "Get the first 10 draft orders", "description": "The following query retrieves the first ten draft orders for a shop and returns the ID for each draft order.", "query_string": "query {\n draftOrders(first: 10) {\n edges {\n node {\n id\n }\n }\n }\n}", "query_arguments": { "first": 10 }, "response": { "data": { "draftOrders": { "edges": [ { "node": { "id": "gid://shopify/DraftOrder/12873508" } }, { "node": { "id": "gid://shopify/DraftOrder/14492994" } }, { "node": { "id": "gid://shopify/DraftOrder/15964851" } }, { "node": { "id": "gid://shopify/DraftOrder/17011624" } }, { "node": { "id": "gid://shopify/DraftOrder/33942910" } }, { "node": { "id": "gid://shopify/DraftOrder/35687358" } }, { "node": { "id": "gid://shopify/DraftOrder/35831665" } }, { "node": { "id": "gid://shopify/DraftOrder/57615313" } }, { "node": { "id": "gid://shopify/DraftOrder/116136825" } }, { "node": { "id": "gid://shopify/DraftOrder/138565067" } } ] } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/draft_orders/test/unit/graph_api/admin/draft_order_test.rb", "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 { draftOrders(first: 10) { edges { node { id } } } }\"\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n draftOrders(first: 10) {\n edges {\n node {\n id\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\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 draftOrders(first: 10) {\n edges {\n node {\n id\n }\n }\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n draftOrders(first: 10) {\n edges {\n node {\n id\n }\n }\n }\n }`,\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query {\n draftOrders(first: 10) {\n edges {\n node {\n id\n }\n }\n }\n }\nQUERY;\n\n$response = $client->query([\"query\" => $query]);\n" }, "titleStringKey": "arguments", "inputVariableEntries": [ { "arg": { "name": "first", "description": "The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).", "type": { "kind": "SCALAR", "name": "Int", "list": false, "non_null": false }, "defaultValue": null, "typeSignature": "Int", "isDeprecated": false, "deprecationReason": null }, "key": "first", "argValue": " 10", "typeKind": "QUERY" } ] }, { "example": { "type_name": "draftorders", "title": "Get the first 10 draft orders created after December 1, 2019", "description": "The following query retrieves the first ten draft orders created after December 1, 2019, and returns the ID and creation date for each draft order.", "query_string": "query {\n draftOrders(first: 10, query: \"created_at:>2019-12-01\") {\n edges {\n node {\n id\n createdAt\n }\n }\n }\n}", "query_arguments": { "first": 10, "query": "created_at:>2019-12-01" }, "response": { "data": { "draftOrders": { "edges": [ { "node": { "id": "gid://shopify/DraftOrder/12873508", "createdAt": "2021-12-01T12:42:15Z" } }, { "node": { "id": "gid://shopify/DraftOrder/14492994", "createdAt": "2021-12-01T12:42:15Z" } }, { "node": { "id": "gid://shopify/DraftOrder/15964851", "createdAt": "2021-12-01T12:42:15Z" } }, { "node": { "id": "gid://shopify/DraftOrder/17011624", "createdAt": "2021-12-01T12:42:15Z" } }, { "node": { "id": "gid://shopify/DraftOrder/33942910", "createdAt": "2021-12-01T12:42:15Z" } }, { "node": { "id": "gid://shopify/DraftOrder/35687358", "createdAt": "2021-12-01T12:42:15Z" } }, { "node": { "id": "gid://shopify/DraftOrder/35831665", "createdAt": "2021-12-01T12:42:15Z" } }, { "node": { "id": "gid://shopify/DraftOrder/57615313", "createdAt": "2021-12-01T12:42:15Z" } }, { "node": { "id": "gid://shopify/DraftOrder/116136825", "createdAt": "2021-12-01T12:42:15Z" } }, { "node": { "id": "gid://shopify/DraftOrder/138565067", "createdAt": "2021-12-01T12:42:15Z" } } ] } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/draft_orders/test/unit/graph_api/admin/draft_order_test.rb", "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 { draftOrders(first: 10, query: \\\"created_at:>2019-12-01\\\") { edges { node { id createdAt } } } }\"\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n draftOrders(first: 10, query: \"created_at:>2019-12-01\") {\n edges {\n node {\n id\n createdAt\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\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 draftOrders(first: 10, query: \"created_at:>2019-12-01\") {\n edges {\n node {\n id\n createdAt\n }\n }\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n draftOrders(first: 10, query: \"created_at:>2019-12-01\") {\n edges {\n node {\n id\n createdAt\n }\n }\n }\n }`,\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query {\n draftOrders(first: 10, query: \"created_at:>2019-12-01\") {\n edges {\n node {\n id\n createdAt\n }\n }\n }\n }\nQUERY;\n\n$response = $client->query([\"query\" => $query]);\n" }, "titleStringKey": "arguments", "inputVariableEntries": [ { "arg": { "name": "first", "description": "The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).", "type": { "kind": "SCALAR", "name": "Int", "list": false, "non_null": false }, "defaultValue": null, "typeSignature": "Int", "isDeprecated": false, "deprecationReason": null }, "key": "first", "argValue": " 10", "typeKind": "QUERY" }, { "arg": { "name": "query", "description": "A filter made up of terms, connectives, modifiers, and comparators.\n| name | type | description | acceptable_values | default_value | example_use |\n| ---- | ---- | ---- | ---- | ---- | ---- |\n| default | string | Filter by a case-insensitive search of all the fields in a document. |\n| created_at | time |\n| customer_id | id |\n| id | id | Filter by `id` range. | | | - `id:1234`<br/> - `id:>=1234`<br/> - `id:<=1234` |\n| source | string |\n| status | string |\n| tag | string |\n| updated_at | time |\nYou can apply one or more filters to a query. Learn more about [Shopify API search syntax](https://shopify.dev/api/usage/search-syntax).\n", "type": { "kind": "SCALAR", "name": "String", "list": false, "non_null": false }, "defaultValue": null, "typeSignature": "String", "isDeprecated": false, "deprecationReason": null }, "key": "query", "argValue": " \"created_at:>2019-12-01\"", "typeKind": "QUERY" } ] }, { "example": { "type_name": "draftorders", "title": "Get the first 10 draft orders with a status of 'OPEN'", "description": "The following query retrieves the first ten draft orders with an 'OPEN' status and returns the ID and status of each draft order.", "query_string": "query {\n draftOrders(first: 10, query: \"status:OPEN\") {\n edges {\n node {\n id\n status\n }\n }\n }\n}", "query_arguments": { "first": 10, "query": "status:OPEN" }, "response": { "data": { "draftOrders": { "edges": [ { "node": { "id": "gid://shopify/DraftOrder/12873508", "status": "OPEN" } }, { "node": { "id": "gid://shopify/DraftOrder/14492994", "status": "OPEN" } }, { "node": { "id": "gid://shopify/DraftOrder/15964851", "status": "OPEN" } }, { "node": { "id": "gid://shopify/DraftOrder/17011624", "status": "OPEN" } }, { "node": { "id": "gid://shopify/DraftOrder/33942910", "status": "OPEN" } }, { "node": { "id": "gid://shopify/DraftOrder/35687358", "status": "OPEN" } }, { "node": { "id": "gid://shopify/DraftOrder/35831665", "status": "OPEN" } }, { "node": { "id": "gid://shopify/DraftOrder/57615313", "status": "OPEN" } }, { "node": { "id": "gid://shopify/DraftOrder/116136825", "status": "OPEN" } }, { "node": { "id": "gid://shopify/DraftOrder/138565067", "status": "OPEN" } } ] } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/draft_orders/test/unit/graph_api/admin/draft_order_test.rb", "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 { draftOrders(first: 10, query: \\\"status:OPEN\\\") { edges { node { id status } } } }\"\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n draftOrders(first: 10, query: \"status:OPEN\") {\n edges {\n node {\n id\n status\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\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 draftOrders(first: 10, query: \"status:OPEN\") {\n edges {\n node {\n id\n status\n }\n }\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n draftOrders(first: 10, query: \"status:OPEN\") {\n edges {\n node {\n id\n status\n }\n }\n }\n }`,\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query {\n draftOrders(first: 10, query: \"status:OPEN\") {\n edges {\n node {\n id\n status\n }\n }\n }\n }\nQUERY;\n\n$response = $client->query([\"query\" => $query]);\n" }, "titleStringKey": "arguments", "inputVariableEntries": [ { "arg": { "name": "first", "description": "The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).", "type": { "kind": "SCALAR", "name": "Int", "list": false, "non_null": false }, "defaultValue": null, "typeSignature": "Int", "isDeprecated": false, "deprecationReason": null }, "key": "first", "argValue": " 10", "typeKind": "QUERY" }, { "arg": { "name": "query", "description": "A filter made up of terms, connectives, modifiers, and comparators.\n| name | type | description | acceptable_values | default_value | example_use |\n| ---- | ---- | ---- | ---- | ---- | ---- |\n| default | string | Filter by a case-insensitive search of all the fields in a document. |\n| created_at | time |\n| customer_id | id |\n| id | id | Filter by `id` range. | | | - `id:1234`<br/> - `id:>=1234`<br/> - `id:<=1234` |\n| source | string |\n| status | string |\n| tag | string |\n| updated_at | time |\nYou can apply one or more filters to a query. Learn more about [Shopify API search syntax](https://shopify.dev/api/usage/search-syntax).\n", "type": { "kind": "SCALAR", "name": "String", "list": false, "non_null": false }, "defaultValue": null, "typeSignature": "String", "isDeprecated": false, "deprecationReason": null }, "key": "query", "argValue": " \"status:OPEN\"", "typeKind": "QUERY" } ] }, { "example": { "type_name": "draftorders", "title": "Get the first draft order for a given customer", "description": "The following query retrieves the first draft order for customer ID 544365967 and returns the ID, status and customer first name of the draft order.", "query_string": "query {\n draftOrders(first: 1, query: \"customerId:544365967\") {\n edges {\n node {\n id\n status\n customer {\n firstName\n }\n }\n }\n }\n}", "query_arguments": { "first": 1, "query": "customerId:544365967" }, "response": { "data": { "draftOrders": { "edges": [ { "node": { "id": "gid://shopify/DraftOrder/12873508", "status": "OPEN", "customer": { "firstName": "Bob" } } } ] } }, "extensions": { "search": [ { "path": [ "draftOrders" ], "query": "customerId:544365967", "parsed": { "field": "customerId", "match_all": "544365967" }, "warnings": [ { "field": "customerId", "message": "Invalid search field for this query." } ] } ] } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/draft_orders/test/unit/graph_api/admin/draft_order_test.rb", "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 { draftOrders(first: 1, query: \\\"customerId:544365967\\\") { edges { node { id status customer { firstName } } } } }\"\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n draftOrders(first: 1, query: \"customerId:544365967\") {\n edges {\n node {\n id\n status\n customer {\n firstName\n }\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\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 draftOrders(first: 1, query: \"customerId:544365967\") {\n edges {\n node {\n id\n status\n customer {\n firstName\n }\n }\n }\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n draftOrders(first: 1, query: \"customerId:544365967\") {\n edges {\n node {\n id\n status\n customer {\n firstName\n }\n }\n }\n }\n }`,\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query {\n draftOrders(first: 1, query: \"customerId:544365967\") {\n edges {\n node {\n id\n status\n customer {\n firstName\n }\n }\n }\n }\n }\nQUERY;\n\n$response = $client->query([\"query\" => $query]);\n" }, "titleStringKey": "arguments", "inputVariableEntries": [ { "arg": { "name": "first", "description": "The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).", "type": { "kind": "SCALAR", "name": "Int", "list": false, "non_null": false }, "defaultValue": null, "typeSignature": "Int", "isDeprecated": false, "deprecationReason": null }, "key": "first", "argValue": " 1", "typeKind": "QUERY" }, { "arg": { "name": "query", "description": "A filter made up of terms, connectives, modifiers, and comparators.\n| name | type | description | acceptable_values | default_value | example_use |\n| ---- | ---- | ---- | ---- | ---- | ---- |\n| default | string | Filter by a case-insensitive search of all the fields in a document. |\n| created_at | time |\n| customer_id | id |\n| id | id | Filter by `id` range. | | | - `id:1234`<br/> - `id:>=1234`<br/> - `id:<=1234` |\n| source | string |\n| status | string |\n| tag | string |\n| updated_at | time |\nYou can apply one or more filters to a query. Learn more about [Shopify API search syntax](https://shopify.dev/api/usage/search-syntax).\n", "type": { "kind": "SCALAR", "name": "String", "list": false, "non_null": false }, "defaultValue": null, "typeSignature": "String", "isDeprecated": false, "deprecationReason": null }, "key": "query", "argValue": " \"customerId:544365967\"", "typeKind": "QUERY" } ] } ]