Which is right the GraphQl orders query or the Rest?

I am trying to run a query to get an understanding of how many orders a customer processes in total and I am getting different numbers from graphQL and rest. Sometimes they are close but sometimes that are so far off that it makes both hard to trust. Can someone help me understand either what I am doing wrong?

Ex 1: Same store, same time period Jan 1 2024 - Jan 22 2024, same api version.

Rest returns 8039
Graph returns 0

The only difference I see is I have status ANY for the rest api and I don’t have anything for the graphQl. Based on the documentation it doesn’t seem like putting any is an option for graphQL

Examples shown below.

Ex 2: Same time period but this year

Rest: 9304
Graph: 9620

Closer but still not the same.

If Rest was higher in the 2025 version I would have thought it had to do with orders being archived but the more I think about it, maybe the answer is GraphQl just doesn’t have access to orders before a certain date? Would love to get this fixed so I can use graphQl in my app but at the moment it still seems unreliable… unless I am doing something wrong. Curious if anyone else has run into this.

Have you tried using the Bulk Operation API instead?

The problem you might be facing is a pagination / query costs one. The REST API has a standard output format, so it doesn’t have the same “cost” per query. Whereas GraphQL you can pick and choose fields which affect how many records can be returned successfully.

If you need to query a large amount of records on a merchant’s store, I highly recommend using the Bulk Operation API instead. It skips the pagination set up and returns all of the data you define in a single response that you can use to count, sum, or do complex math with.

This seems like a simple query though. Not pagination just return the number of orders.

Bulk probably makes sense for returning all of the orders from a store or something like that but this is just a quick count api request.

I’m sorry, my coffee is clearly wearing off. I didn’t notice you were using a special ordersCount attribute on the shop itself, not paginating over the customer’s orders connection.

I didn’t even realize there was a dedicated ordersCount query available.

The search syntax in the GraphQL API is very finicky in my experience. I’ve had to sometimes play around with quotations, make sure spaces are removed from around comparison characters, ISO formatting, etc.

I also wouldn’t rule out there’s bugs in the Search syntax itself or subtle differences from REST API search to GraphQL search.

Ex 1: It should be because the access token doesn’t have read_all_orders scope.
Ex 2: Can you try adding status field in the filter in GraphQL query?