A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
I've got an issue where I can query and get all the orders. But on some query parameters, the counts drop inexplicably. Here's my simple base graphql query:
query getOrders($myquery: String!) {
orders(first:250, query: $myquery) {
edges {
node {
id
createdAt
displayFinancialStatus
cancelledAt
}
}
}
}
Now here are some various query parameters I pass in and the records returned (bolded make no sense to me)
"query" : "created_at:>'2022-05-01T23:39:20Z'" : returns 250
"query" : "created_at:>'2022-05-01T23:39:20Z' and created_at:<'2024-10-25T23:39:20Z'" : returns 10
"query" : "created_at:>'2022-05-01T23:39:20Z' and -financial_status:refunded" : returns 10
"query" : "-financial_status:refunded" : returns 250
"query" : "-financial_status:refunded and -status:cancelled" : returns 10
The bolded make no sense. I checked orders that would show vs those that don't and couldn't find a difference. And I tried this on two different stores and same effect (differing counts) which makes no sense. Is the "and" not correct or something?
Hi, Mad
and should be uppercase in query ,otherwise it will not works .
pls try '"query" : "created_at:>'2022-05-01T23:39:20Z' AND created_at:<'2024-10-25T23:39:20Z'"