I am trying to run a query for all orders that don’t have any paymentGatewayNames associated with them, I have the following query,
{
orders(first: 100, query: "NOT gateway:*")
{
nodes
{
id
paymentGatewayNames
transactions{
id
}
}
}
}
And it does return some orders, but not all. When I add an id of one of the missing orders like so
orders(first: 100, query: "id:******** AND NOT gateway:*")
{
nodes
{
id
paymentGatewayNames
transactions{
id
}
}
}
It does not return the order. Modifying the query like so
{
orders(first: 100, query: "id:*********** AND gateway:*")
{
nodes
{
id
paymentGatewayNames
transactions{
id
}
}
}
}
does return the order. However there is no payment gateway name for this particular order, the payment gateway names array is empty.
Here is the response for that query
{
"data": {
"orders": {
"nodes": [
{
"id": "gid://shopify/Order/********",
"paymentGatewayNames": [],
"transactions": []
}
]
}
},
"extensions": {
"cost": {
"requestedQueryCost": 20,
"actualQueryCost": 2,
"throttleStatus": {
"maximumAvailable": 2000.0,
"currentlyAvailable": 1998,
"restoreRate": 100.0
}
},
"search": [
{
"path": [
"orders"
],
"query": "id:*********** AND gateway:*",
"parsed": {
"and": [
{
"field": "id",
"match_all": "***********"
},
{
"field": "gateway",
"exists": true
}
]
}
}
]
}
}
Both payment gateway names and transactions are empty arrays, so it should have the gateway exists resolve to false, and not return in this query. Rather is should have returned in the other query, where NOT gateway:* is specified.
In short:
Expected: Queries with NOT gateway:* should return ALL orders without gateways
Actual: Some orders are missing
Expected: Queries with gateway:* should NOT retrun ANY orders without gateways
Actual: Some orders are returned
x-request-id for debugging: 0b02f405-8b74-4458-9912-e2f4cada7001-1765398282