Closed
Description
When I try to run the Order
query passing an orderNumber
as id
order(idType: ORDER_NUMBER, id: "123") {
orderNumber
orderKey
}
I get an error: "No order ID was found corresponding to the order_number: 123"
If I pass an orderKey
instead:
order(idType: ORDER_NUMBER, id: "wc_order_Zjd4Iusj4poZ") {
orderNumber
orderKey
}
I get the wanted response:
{
"order": {
"orderNumber": "123",
"orderKey": "wc_order_Zjd4Iusj4poZ"
}
}
Looking at the code, I've found the step where this check is executed:
wp-graphql-woocommerce/includes/type/object/class-root-query.php
Lines 187 to 190 in 23c7f30
To query by the orderNumber
,this would have to change for a orderNumber "lookup".
If passing the orderKey
is the expected behaviour, I suppose changing the idType
to ORDER_KEY
would avoid this confusion.