A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
I am getting "INTERNAL_SERVER_ERROR" for the below query. There are no details about what caused the error in the response.
Appreciate any help! Thanks!
mutation {
bulkOperationRunQuery(query: """
{
orders {
edges {
node {
id
fulfillable
fulfillmentOrders {
edges {
node {
id
requestStatus
status
supportedActions {
action
externalUrl
}
merchantRequests {
edges {
node {
id
kind
}
}
}
deliveryMethod {
id
methodType
}
destination {
id
address1
address2
city
company
countryCode
email
firstName
lastName
phone
province
zip
}
lineItems {
edges {
node {
id
lineItem {
id
fulfillableQuantity
originalTotalSet {
presentmentMoney {
amount
}
}
fulfillmentService {
id
callbackUrl
fulfillmentOrdersOptIn
handle
inventoryManagement
productBased
serviceName
shippingMethods {
code
label
}
type
}
duties {
id
countryCodeOfOrigin
harmonizedSystemCode
taxLines {
priceSet {
presentmentMoney {
amount
}
}
}
price {
presentmentMoney {
amount
}
}
}
discountedUnitPriceSet {
presentmentMoney {
amount
}
}
customAttributes {
key
value
}
}
}
}
}
}
}
}
fulfillments {
id
createdAt
deliveredAt
displayStatus
estimatedDeliveryAt
}
}
}
}
}
""") {
bulkOperation {
id
status
}
userErrors {
field
message
}
}
}
Solved! Go to the solution
This is an accepted solution.
Just for the record, if anyone comes across the error while firing a similar query.
Removing fulfillmentService from the query solved it. No idea why.
When posting about errors on the forums it is very helpful to include the x-request-id which is found in the response headers. Please paste a recent example here and that will help with debugging from Shopify.
To learn more visit the Shopify Help Center or the Community Blog.
@vix sure I will be adding ths request ID up-front in the future.
Please find x-request-id from the recent transaction: dc0f59e3-b1c5-4a4d-a1a5-c3a0c2b56e0d
Thanks!
This is an accepted solution.
Just for the record, if anyone comes across the error while firing a similar query.
Removing fulfillmentService from the query solved it. No idea why.
First, does your query even run for retrieving a single order? You still have to obey the rules with bulk queries, so if you're breaking any, best to know before you go big. So if your query runs as a "hey, get me one order", maybe then you can ask questions. If it does not work for even one order, you'll likely know why. Additionally, you know you cannot nest more than 3 layers, but right away, looking at your code, you seem to go deeper. Only you can fine tune this, but it seems the easy steps might've been skipped?
@HunkyBill yes, I can retrieve the single order with the same query and partial data is also available from the bulk query.
If the Bulk Query rules are broken then Shopify fails the query immediately in most cases.
I have only nested 3 layers, not more. There are only three `edges` which is counted as connections.