Hello,
Trying to query cancelled orders only. They should have non-null values:
“cancel_reason” and “cancelled_at” - REST syntax
“cancelReason” and “cancelledAt” - GraphiQL syntax
First query I tried should return all orders after specified date with non-null cancel reason (according to syntax guide “*” should do that):
{
orders(query:"created_at:>'2023-04-02T00:00:00' AND cancel_reason:*", first: 100) {
edges {
node {
id
createdAt
cancelReason
cancelledAt
}
}
pageInfo {
hasNextPage
}
}
}
But actually this query returns all orders after the date specified (2023-04-02) both with null “cancelReason” values and containing text.
My second attempt was to search by cancelled date:
{
orders(query:"cancelled_at:>'2023-04-02T00:00:00'", first: 100) {
edges {
node {
id
cancelReason
cancelledAt
}
}
pageInfo {
hasNextPage
}
}
}
But this query just returns all orders - both with null “cancelledAt” values and any with date populated.
I also tried to put “cancelReason” and “cancelledAt” variables (GraphiQL syntax instead of REST one) for those queries but this doesn’t change the query result.