When using the nodes query to fetch refund details (including transactions, refundLineItems, refundShippingLines, orderAdjustments) for multiple orders at once, the API returns a raw HTTP 500:
{"errors": "Internal Server Error"}
The query works fine for each order individually and for smaller batches. The 500 only occurs when the combined response size would be large. This is consistent and reproducible, not intermittent.
Query to reproduce:
query getOrdersByIds($ids: [ID!]!) {
nodes(ids: $ids) {
... on Order {
id
refunds(first: 200) {
id
createdAt
note
updatedAt
totalRefundedSet {
shopMoney { amount, currencyCode }
presentmentMoney { amount, currencyCode }
}
transactions(first: 50) {
nodes {
id
authorizationCode
amountSet {
presentmentMoney { amount, currencyCode }
shopMoney { amount, currencyCode }
}
gateway
kind
receiptJson
status
test
createdAt
paymentId
processedAt
}
}
refundShippingLines(first: 100) {
nodes {
id
subtotalAmountSet { shopMoney { amount, currencyCode } }
taxAmountSet { shopMoney { amount, currencyCode } }
}
}
refundLineItems(first: 100) {
nodes {
id
location { id }
quantity
restockType
subtotalSet {
shopMoney { amount, currencyCode }
presentmentMoney { amount, currencyCode }
}
totalTaxSet {
shopMoney { amount, currencyCode }
presentmentMoney { amount, currencyCode }
}
lineItem { id }
}
}
orderAdjustments(first: 100) {
nodes {
id
amountSet {
shopMoney { amount, currencyCode }
presentmentMoney { amount, currencyCode }
}
taxAmountSet { shopMoney { amount, currencyCode } }
}
}
}
}
}
}
Variables:
{
"ids": [
"gid://shopify/Order/7258900562216",
"gid://shopify/Order/7258050036008",
"gid://shopify/Order/7258312671528",
"gid://shopify/Order/7258622787880",
"gid://shopify/Order/7256423301416",
"gid://shopify/Order/7257950486824",
"gid://shopify/Order/7258555318568",
"gid://shopify/Order/7257456214312",
"gid://shopify/Order/7258446528808",
"gid://shopify/Order/7255570776360"
]
}