INTERNAL_SERVER_ERROR on bulk graphql query

Hello,

We are trying to get Discount Codes for a Shopify Store and are getting INTERNAL_SERVER_ERROR, even after multiple retries. The issue seems to only occur for this specific Shopify Store.

Bulk Operation Id: gid://shopify/BulkOperation/4999134281894
X-Request-ID: 2e736986-3a46-4464-b1d2-c80db5548679-1721217396

Looking forward to hearing from you

Hi @bartlomiejradzi

Please send out the request parameters and take a look.

Hello @Kyle_liu

This is the query that we run inside the bulk operation:

query{codeDiscountNodes(query:\"discount_type:bogo OR discount_type:free_shipping OR discount_type:fixed_amount OR discount_type:percentage\"){edges{node{id codeDiscount{__typename ... on DiscountCodeApp{title} ... on DiscountCodeBasic{title asyncUsageCount summary status startsAt endsAt minimumRequirement{__typename ... on DiscountMinimumQuantity{greaterThanOrEqualToQuantity} ... on DiscountMinimumSubtotal{greaterThanOrEqualToSubtotal{amount}}} customerGets{value{__typename ... on DiscountAmount{amount{amount}} ... on DiscountOnQuantity{quantity{quantity}} ... on DiscountPercentage{percentage}}} totalSales{amount} codes{edges{node{id code}}}} ... on DiscountCodeBxgy{title asyncUsageCount summary status startsAt endsAt totalSales{amount} codes{edges{node{id code}}}} ... on DiscountCodeFreeShipping{title asyncUsageCount summary status startsAt endsAt minimumRequirement{__typename ... on DiscountMinimumQuantity{greaterThanOrEqualToQuantity} ... on DiscountMinimumSubtotal{greaterThanOrEqualToSubtotal{amount}}} totalSales{amount} codes{edges{node{id code}}}}}}}}}

And this is the response we are receiving:

{"data":{"currentBulkOperation":{"id":"gid://shopify/BulkOperation/5001267249318","status":"RUNNING","errorCode":"INTERNAL_SERVER_ERROR","url":null}},"extensions":{"cost":{"requestedQueryCost":1,"actualQueryCost":1,"throttleStatus":{"maximumAvailable":20000.0,"currentlyAvailable":19999,"restoreRate":1000.0}}}}%

Thanks

Hi Bartlomiejradzi,

I’ve looked up the error on our internal logs and I can’t find any extra info to determine why this is happening - it’s possible another app could be interfering with this query? I’d recommend asking the merchant to contact support directly and they’ll be able to look deeper once they authenticate the merchant.

Hi @bartlomiejradzi

Try this code out

query{
    codeDiscountNodes(first:10,query:"discount_type:bogo OR discount_type:free_shipping OR discount_type:fixed_amount OR discount_type:percentage"){
        edges{
            node{
                id 
                codeDiscount{
                    __typename 
                    ... on DiscountCodeApp{
                        title
                    } 
                    ... on DiscountCodeBasic{
                        title 
                        asyncUsageCount 
                        summary 
                        status 
                        startsAt 
                        endsAt 
                        minimumRequirement{
                            __typename 
                            ... on DiscountMinimumQuantity{
                                greaterThanOrEqualToQuantity
                            } 
                            ... on DiscountMinimumSubtotal{
                                greaterThanOrEqualToSubtotal{
                                    amount
                                }
                            }
                        } 
                        customerGets{
                            value{
                                __typename 
                                ... on DiscountAmount{
                                    amount{
                                        amount
                                    }
                                } 
                                ... on DiscountOnQuantity{
                                    quantity{
                                        quantity
                                    }
                                } 
                                ... on DiscountPercentage{
                                    percentage
                                }
                            }
                        } 
                        totalSales{
                            amount
                        } 
                        codes (first:10){
                            edges{
                                node{
                                    id 
                                    code
                                }
                            }
                        }
                    } 
                    ... on DiscountCodeBxgy{
                        title 
                        asyncUsageCount 
                        summary 
                        status 
                        startsAt 
                        endsAt 
                        totalSales{
                            amount
                        } 
                        codes (first:10){
                            edges{
                                node{
                                    id 
                                    code
                                }
                            }
                        }
                    } 
                    ... on DiscountCodeFreeShipping{
                        title 
                        asyncUsageCount 
                        summary
                        status 
                        startsAt 
                        endsAt 
                        minimumRequirement{
                            __typename 
                            ... on DiscountMinimumQuantity{
                                greaterThanOrEqualToQuantity
                            } 
                            ... on DiscountMinimumSubtotal{
                                greaterThanOrEqualToSubtotal{
                                    amount
                                }
                            }
                        } 
                        totalSales{
                            amount
                        } 
                        codes  (first:10){
                            edges{
                                node{
                                    id 
                                    code
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}