Inventory_behaviour on createOrder (GraphQL)

Hi There,

I am wondering how we set the inventory_behaviour on graphQL? It is documented in REST documentation but cant find in the graphQL orderCreate Mutation Documentation.

https://shopify.dev/docs/api/admin-rest/latest/resources/order#[post]/admin/api/2021-10/orders.json

Hi @ChrisBradley,

This one is easy to miss since you need to include it separately from order argument through the options argument.

So an example mutation would be:

mutation orderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {
  orderCreate(order: $order, options: $options) {
    userErrors {
      field
      message
    }
    order {
      id
    }
  }
}

With variables:

{
  "order": {
    "lineItems": [
      {
        "variantId": "gid://shopify/ProductVariant/43729076",
        "quantity": 1
      }
    ],
    "email": "foo@shopify.com",
    "fulfillmentStatus": "FULFILLED"
  },
  "options": {
    "inventoryBehaviour": "DECREMENT_IGNORING_POLICY",
    "sendReceipt": true,
    "sendFulfillmentReceipt": true
  }
}