Have your say in Community Polls: What was/is your greatest motivation to start your own business?
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 Admin API - example Throttled request's response

Solved

GraphQL Admin API - example Throttled request's response

Daniel-LiveChat
Shopify Partner
11 0 7

Hello, fellow devs! I'm working on GraphQL Admin API Rate Limit, and the documentation mentions as below:

 

All requests that are made after the limit has been exceeded are throttled and an {errors: [{ message: "Throttled" }]} error is returned.

Does any of you could share an example response from the request that was throttled? It's hard for me to exceed the limits as our dev stores do not have enough data (i.e., orders or customers). I'm especially looking for a response body, and status code returned in case of exceeding API limits.

Accepted Solution (1)
AddisonApps
Shopify Partner
56 6 14

This is an accepted solution.

Here is an example of a throttled request:

{
   "errors":[
      {
         "message":"Throttled"
      }
   ],
   "extensions":{
      "cost":{
         "requestedQueryCost":202,
         "actualQueryCost":null,
         "throttleStatus":{
            "maximumAvailable":1000.0,
            "currentlyAvailable":118,
            "restoreRate":50.0
         }
      }
   }
}

View solution in original post

Replies 7 (7)

AddisonApps
Shopify Partner
56 6 14

The status code returned on throttled request should be 429.

Daniel-LiveChat
Shopify Partner
11 0 7

For sure it's 429 for Admin REST API, but the documentation doesn't mention if it's true for GraphQL API too. Thanks anyway @AddisonApps 🙂

AddisonApps
Shopify Partner
56 6 14

This is an accepted solution.

Here is an example of a throttled request:

{
   "errors":[
      {
         "message":"Throttled"
      }
   ],
   "extensions":{
      "cost":{
         "requestedQueryCost":202,
         "actualQueryCost":null,
         "throttleStatus":{
            "maximumAvailable":1000.0,
            "currentlyAvailable":118,
            "restoreRate":50.0
         }
      }
   }
}
Daniel-LiveChat
Shopify Partner
11 0 7

Thanks a ton, @AddisonApps!

Denedric_McCull
Visitor
2 0 0

I am having a throttled error when attempting to add photos to products. Please help.

cmayer
Shopify Partner
1 0 0

Is the "extensions" object indeed outside of "errors"? The documentation makes it looks like it should be within the error object. Can you confirm or have the documentation updated? Thanks

https://shopify.dev/api/admin-graphql#status_and_error_codes

garyrgilbert
Shopify Partner
431 41 186

Its definitely outside the documentation is wrong.

 

I forced an error with a query and this is the result, "errors", "data", and "extensions" are all on the top level, though if you have gotten a throttle there wont be "data" just "errors" and " extensions"

 

{
  "errors": [
    {
      "message": "first cannot exceed 250. To query larger amounts of data with fewer limits, bulk operations should be used instead.\nSee https://shopify.dev/api/usage/bulk-operations/queries for usage details.\n",
      "locations": [
        {
          "line": 2,
          "column": 17
        }
      ],
      "path": [
        "productVariants"
      ]
    }
  ],
  "data": null,
  "extensions": {
    "cost": {
      "requestedQueryCost": 46,
      "actualQueryCost": 2,
      "throttleStatus": {
        "maximumAvailable": 20000,
        "currentlyAvailable": 19998,
        "restoreRate": 1000
      }
    }
  }
}

 Cheers,

Gary

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution