A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
I am trying to filter orders by their financial status and it keeps returning all orders. Even in the example in the documentation it doesn't seem to work as intended: https://shopify.dev/api/admin-graphql/2022-10/queries/orders#examples-Get_the_first_10_orders_with_a...
The example shows both PAID and AUTHORIZED orders. Though, perhaps it included paid because it is a state that comes after authorized. However, my query keeps giving me all orders, which are all in pending. Here is what I'm using to make the query.
query {
orders(first:20, query: "financial_status:PAID"){
edges{
node{
id
name
displayFinancialStatus
}
}
}
}
This is the output I get.
{
"data": {
"orders": {
"edges": [
{
"node": {
"id": "gid://shopify/Order/",
"name": "#1001",
"displayFinancialStatus": "PENDING"
}
},
{
"node": {
"id": "gid://shopify/Order/",
"name": "#1002",
"displayFinancialStatus": "PENDING"
}
},
{
"node": {
"id": "gid://shopify/Order/",
"name": "#1003",
"displayFinancialStatus": "PENDING"
}
},
{
"node": {
"id": "gid://shopify/Order/",
"name": "#1004",
"displayFinancialStatus": "PENDING"
}
},
{
"node": {
"id": "gid://shopify/Order/",
"name": "#1005",
"displayFinancialStatus": "PENDING"
}
},
{
"node": {
"id": "gid://shopify/Order/",
"name": "#1006",
"displayFinancialStatus": "PENDING"
}
},
{
"node": {
"id": "gid://shopify/Order/",
"name": "#1007",
"displayFinancialStatus": "PENDING"
}
}
]
}
},
"extensions": {
"cost": {
"requestedQueryCost": 22,
"actualQueryCost": 9,
"throttleStatus": {
"maximumAvailable": 1000,
"currentlyAvailable": 991,
"restoreRate": 50
}
}
}
Is there something else I need to do to get this query working?
I encounter the same problem but I solved by lower case.
orders(first:20, query: "financial_status:paid")
Yes, it works by using lower case, thanks!