I have a custom app installed on a Plus store which calls orders and associated data for a certain time period from the API and prints to a .csv file.
However, some orders are not found by the call to the API. I have tested the query with the GraphiQL app installed on the store but the missing orders appear in those calls using the same query and variables.
Is there any reason why some order objects might not be returned by an API call in an app versus in the GraphiQL app in the store admin?
Query code:
query (
$results: Int!,
$cursor: String,
$order_window: String
) {
orders(
first: $results,
after: $cursor,
query: $order_window,
reverse: true
) {
pageInfo {
hasNextPage
hasPreviousPage
}
edges {
cursor
node {
name
id
test
cancelledAt
shippingAddress {
lastName
firstName
address1
address2
city
province
country
zip
phone
}
displayFinancialStatus
fullyPaid
createdAt
app {
name
}
nonFulfillableLineItems (first: 25 ) {
edges {
node {
id
title
}
}
}
customer {
id
firstName
lastName
email
tags
ordersCount
deliveryComment: metafield(
namespace: "global"
key: "order_note"
) {
value
}
}
lineItems (
first: 25
) {
edges {
node {
id
title
variantTitle
}
}
}
}
}
}
}
Variables:
{
"results": 10,
"cursor": cursor,
"order_window": "created_at:>#{start_date} AND created_at:<#{end_date}"
}
Thank you