A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hello,
We are trying to get Orders in Bulk with the GraphQL admin api, and encountered some strange behaviour. To the best of my knowledge, we have read_all_orders and unauthenticated_read_customers scope required.
The query returns a JSONL file with results as expected, but for some reason, it only returns data from the end of 2020, some early 2021. If we query for anything newer in particular (last two days for example), we get zero results. Checking for old data, we are getting a valid response with the expected outcome. This seems to be the behaviour across multiple stores tested.
If I try the same query in non-bulk against the GraphQL api with limits though, I can get fresh data, so it seems like the data is there.
The query (without the created_at limit):
mutation {
bulkOperationRunQuery(
query: """
{
orders {
edges {
node {
id
legacyResourceId
createdAt
cancelledAt
name
refunds {
id
}
channel {
app {
id
}
}
totalPrice
fulfillments {
id
order {
id
createdAt
}
}
metafields {
edges {
node {
id
legacyResourceId
key
value
}
}
}
shippingAddress {
address1
address2
city
company
country
countryCode
countryCodeV2
firstName
id
formattedArea
lastName
latitude
longitude
name
phone
province
provinceCode
zip
formatted(withName: false)
}
lineItems {
edges {
node {
__typename
quantity
product {
id
legacyResourceId
}
variant {
id
legacyResourceId
}
}
}
}
}
}
}
}
"""
) {
bulkOperation {
id
status
}
userErrors {
field
message
}
}
}
If I run a bulk query on other objects, like Customers, we are getting correct data back as expected, including fresh data. This issue seems to be particular to Orders in our case.
Did anyone encountered anything like this before?