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.

GraphQL - Orders Query - Internal error for specific merchant when "OR" relation occurs in query

GraphQL - Orders Query - Internal error for specific merchant when "OR" relation occurs in query

BarkAI_Andrii
Shopify Partner
3 0 0
GraphQL request fails for specific merchant only. Internal tests showed that the issue disappears if the "OR" relation is removed from the query. Note, that this query is used as part of the bulk query.

Sample request id: 
ba23048a-66f3-4c50-bf2e-1ff7bb348c38
Sample request payload:

 

`
query ordersByQuery {
  orders(first: 1, query: "(created_at:>='2023-08-27') OR (updated_at:>='2023-08-27')") {
    pageInfo {
      hasNextPage
    }
    edges {
      cursor
      node {
        id
        createdAt
        updatedAt
        email
        totalPriceSet {
          shopMoney {
            amount
          }
        }
        channelInformation {
          channelDefinition {
            channelName
            subChannelName
          }
        }
        refunds {
          createdAt
          totalRefundedSet {
            shopMoney {
              amount
            }
          }
        }
      }
    }
  }
}
`

 

 
Replies 3 (3)

Liam
Community Manager
3108 344 911

Hi BarkAI_Andrii,

 

This issue might be caused by a number of factors, including rate limiting or a merchant-specific setting that's causing the query to fail. Here are some steps to troubleshoot this issue:

  1. Check for rate limiting: Shopify GraphQL API has a rate limit of 1000 points per second, which is shared across all apps installed by a merchant. If your app exceeds this limit, then further API calls will fail until the rate limit resets. You can check the X-Shopify-Shop-Api-Call-Limit header in the response to see your app's current call limit usage.

  2. Check the query format: The format of your query looks correct, but it may be worth double-checking for any minor errors such as missing brackets or incorrect field names.

  3. Test the query in the Shopify GraphiQL App: You can test your query in the Shopify GraphiQL App to see if it works there. If it does, then the issue might be with how your app is making the API call.

Try out the above and see if it resolves your issue, hope this helps,

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

BarkAI_Andrii
Shopify Partner
3 0 0

Thank you for such a quick response! As far as I see:

  1. Check for rate limiting: It's not a rate-limiting issue as, first of all, an exception from Shopify backend returns an internal error.
  2. Check the query format: It's not a problem with the query format, as our application is installed for a number of merchants, and this exception occurs only for a single one.
  3. Test the query in the Shopify GraphiQL App: the same as the previous

 

Our team would be grateful if the Shopify support team would give this issue more attention.

 

Thank you for your kind support! 

BarkAI_Andrii
Shopify Partner
3 0 0

This just kind reminder to review my previous comment 😊