We are attempting to create orders using the orderCreate mutation on GraphQL version 2025-01.
Sample query:
mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {
orderCreate(order: $order, options: $options) {
userErrors {
field
message
}
order {
id
displayFinancialStatus
customer {
email
firstName
lastName
}
}
}
}
If I set the variables with the following data:
{
"order":{
... # ommited for brevity
},
"options":{
"inventoryBehavior":"DECREMENT_OBEYING_POLICY"
}
}
I get back the following response:
{
"errors": [
{
"message": "Variable $options of type OrderCreateOptionsInput was provided invalid value for inventoryBehavior (Field is not defined on OrderCreateOptionsInput)",
"locations": [
{
"line": 1,
"column": 54
}
],
"extensions": {
"value": {
"inventoryBehavior": "DECREMENT_OBEYING_POLICY"
},
"problems": [
{
"path": [
"inventoryBehavior"
],
"explanation": "Field is not defined on OrderCreateOptionsInput"
}
]
}
}
]
}
Other options fields (such as OrderCreateOptionsInput.sendReceipt) don’t exhibit this behavior, so I’m assuming I’m making a basic syntactical error of some sort. The actual error is confusing, as it appears to say both that the field inventoryBehavior does not exist (is not defined) and the value is invalid.