Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

INTERNAL_SERVER_ERROR on bulk graphql query

Solved

INTERNAL_SERVER_ERROR on bulk graphql query

bartlomiejradzi
Shopify Partner
3 0 3

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

Accepted Solution (1)

Liam
Community Manager
3108 344 910

This is an accepted solution.

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.

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Replies 4 (4)

Kyle_liu
Shopify Partner
441 55 80

Hi @bartlomiejradzi 

 

Please send out the request parameters and take a look.

If this is helpful, please Like and Accept the solution.
Want to modify or custom changes on store? Let me help.
- Feel free to contact me Email Me Buy Me A Coffee
bartlomiejradzi
Shopify Partner
3 0 3

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

Kyle_liu
Shopify Partner
441 55 80

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
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
If this is helpful, please Like and Accept the solution.
Want to modify or custom changes on store? Let me help.
- Feel free to contact me Email Me Buy Me A Coffee

Liam
Community Manager
3108 344 910

This is an accepted solution.

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.

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog