GraphQL orders query bulk request failing with internal server error

Topic summary

A GraphQL bulk operation for querying orders consistently fails with an Internal Server Error on certain shops, despite working fine when tested through the Shopify GraphQL App.

Query Details:

  • Targets orders with query: "updated_at:*"
  • Requests extensive nested data including line items, products, variants, inventory, tax lines, and pricing information
  • A different bulk query for locations executes successfully

Key Findings:

  • Error began appearing in April 2023 after upgrading to API version 2023-04
  • Testing reveals the same request works properly with older API versions (2022-07 and 2022-10)
  • The failing shop contains only demo data
  • Issue appears version-specific rather than permission-related

Troubleshooting Suggestions:

  • Verify identical access scopes between testing apps
  • Test using HTTP clients (Postman/Insomnia) with same app permissions
  • Review bulk operation failure reasons in documentation

Status: Unresolved. The problem seems tied to the 2023-04 API version migration, but root cause remains unclear.

Summarized with AI on November 18. AI used: claude-sonnet-4-5-20250929.

We consistently get Internal Server Error (as above) on some of the bulk requests. The query in question:

{
    orders(query: "updated_at:*")
    {
        edges
        {
            node
            {
                id
                createdAt
                name
                updatedAt
                physicalLocation { id name }
                totalShippingPriceSet { shopMoney { amount } }
                totalDiscountsSet { shopMoney { amount } }
                lineItems {
                    edges {
                        node {
                            id
                            product {
                                id
                                title
                                productType
                                vendor
                             }
                            variantTitle
                            name
                            variant {
                                id
                                selectedOptions { name value }
                                taxCode
                                taxable
                                sku
                                inventoryItem {
                                    id
                                    sku
                                    unitCost { amount }
                                }
                            }
                            totalDiscountSet { shopMoney { amount } }
                            discountedTotalSet { shopMoney { amount } }
                            quantity
                            taxLines {
                                priceSet {
                                    shopMoney { amount }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

The same query completes correctly when we mimic the bulk request with Shopify GraphQL app.

A different query (locations(query:“updated_at:>*”) {…}) executes fine.

The failing shop has demo only demo data, and the response is like this:

/admin/api/2023-04/graphql.json
Date: Thu, 10 Aug 2023 11:23:42 GMT
X-Request-ID: fbb7730d-352f-4284-9e2a-dedbc6595875
{'id': 'gid://shopify/BulkOperation/4022380626250', 'url': None, 'status': 'FAILED', 'errorCode': 'INTERNAL_SERVER_ERROR', 'objectCount': '0', 'fileSize': None, 'partialDataUrl': None}

Hi @Madis ,

We can’t provide authenticated support in the forums to look into your specific example, but bulk operations can fail for any of the same reasons that normal queries can.

If you can bulk query locations, but not orders, have you tested the same queries in a normal request to the GraphQL Admin API?

  • If the errors persist there, they should also raise a more helpful message to troubleshoot with.

Hope that helps.

As mentioned earlier the when we mimic the bulk request using the Shopify GraphQL App (https://shopify.dev/docs/apps/tools/graphiql-admin-api) installed to that specific store it all looks fine.

I’d recommend testing with an HTTP client like Postman or Insomnia so you can use the same app permission when testing, but if you want to use GraphiQL, have you tried confirming access scopes to make sure both apps have identical access?

This error invariably started to occur some time in April when we upgraded to 2023-04 API version. Now testing different API versions it appears the same request works fine with 2022-07 and 2022-04. We migrated from the latter to the then-current version.

1 Like