Graphql API mutation error

x-request-id:35538e34-faaf-49d9-9e8a-4b54665f5211-1734451478

Hello,

We are switching from REST to GraphqlAPI and I have seen some strange behaivor.

By mutating the order’s shipping address and an extra order.email or order.phone we get a “Too many attempts” error, which is not expected. Here are the details:

Query: mutation orderUpdate($input: OrderInput!) {
orderUpdate(input: $input) {
order {
id
email
note
shippingAddress {
firstName
lastName
address1
address2
city
phone
zip
}
}
userErrors {
field
message
}
}
}

Variables:
{input:{
id: ‘gid://shopify/Order/5789426254002’,
email: ‘new.email1@example.com’,
note: ‘i am the note tényleg1’,
shippingAddress: {
firstName: ‘Jane1’,
lastName: ‘Doe1’,
zip: ‘6001’,
city: ‘New York1’,
address1: ‘123 Shopify Way1’,
address2: ‘asd1’,
phone: ‘+36203333331’
}
}}

The response what we get is:

{
data: {
orderUpdate: {
order: null,
userErrors: [{ field: null, message: ‘Too many attempts. Please try again later.’ }],
},
},
extensions: {
cost: {
requestedQueryCost: 11,
actualQueryCost: 10,
‘throttle Status’: {
maximumAvailable: 2000,
currentlyAvailable: 1990,
restoreRate: 100,
},
},
},
};

We have also noticed it happens only if we want to mutate in one mutation an order property like email or phone and one of a shippingAddress property.

By the rest API we could update the order’s resource in one request, but here is not possible currently.

Would you be so kind to check it what is going on there?

I also noticed if we update an email and ANY other order resource we receive this.

So this variables are leading to that error:
{
“id”: “gid://shopify/Order/5789426254002”,
“email”: “new.email1@example.com”,
“note”: “i am the note tényleg1”,
“shippingAddress”: {
“firstName”: “Jane”,
“lastName”: “Doe1”,
“zip”: “60050”,
“city”: “New York1”,
“address1”: “123 Shopify Way1”,
“address2”: “asd1”,
“phone”: “+36203333331”
}
}

but if we just get rid of the email property everyting works as expected:
{
“id”: “gid://shopify/Order/5789426254002”,

“note”: “i am the note tényleg1”,
“shippingAddress”: {
“firstName”: “Jane”,
“lastName”: “Doe1”,
“zip”: “60050”,
“city”: “New York1”,
“address1”: “123 Shopify Way1”,
“address2”: “asd1”,
“phone”: “+36203333331”
}
}

We get also this “Too many attempts” error if we want to update ANY order property besides the emal like:

{
“id”: “gid://shopify/Order/5789426254002”,
“email”: “new.email1@example.com”,
“shippingAddress”: {
“firstName”: “Jane”,
}
}

Could you please use the mutation query below?

Include your token as a X-Shopify-Access-Token header on all API queries.

1: Mutation Query:

mutation orderUpdate($input: OrderInput!) {
  orderUpdate(input: $input) {
    order {
      id
      email
      note
      shippingAddress {
        firstName
        lastName
        address1
        address2
        city
        phone
        zip
      }
    }
    userErrors {
      field
      message
    }
  }
}

2: Variables

{
  "input": {
    "id": "gid://shopify/Order/5789426254002",
    "email": "new.email1@example.com",
    "note": "i am the note tényleg1",
    "shippingAddress": {
      "firstName": "Jane1",
      "lastName": "Doe1",
      "zip": "6001",
      "city": "New York1",
      "address1": "123 Shopify Way1",
      "address2": "asd1",
      "phone": "36203333331"
    }
  }
}

Sample: How to retrieve a list of products using the GraphQL Admin API

Hello AMal!

Thank you for your fast reply!

If I am not wrong I have pasted the exact same format as you asked.

I also receive an error if i just want to update the email only:

Request:
{
“query”: “mutation orderUpdate($input: OrderInput!) {orderUpdate(input: $input) { order { id email } userErrors { field message } } }”,
“variables”:{
“input”: { “id”: “gid://shopify/Order/5807461662898” , “email":"asd@gmail.com” }
}
}

Response is the exact same, “Too many attempts”
{“data”:{“orderUpdate”:{“order”:null,“userErrors”:[{“field”:null,“message”:“Too many attempts. Please try again
later.”}]}},“extensions”:{“cost”:{“requestedQueryCost”:10,“actualQueryCost”:10,“throttleStatus”:{“maximumAvailable”:2000,“currentlyAvailable”:1990,“restoreRat
e”:100}}}}

Would you be so kind to check it what is going on here?

Thank you in advance!

Ákos

I also receive this in the shopify admin page.

Have you found any solution, as when I’m using any of the mutation API after 4 successful API it giving an error ‘Too many attempts. Please try again later.’ inside the userErrors even through the throttleStatus: { maximumAvailable: 2000, currentlyAvailable: 1835, restoreRate: 100 }.

I’m using Remix app template for app development.

Hello Kapil,

Unfortunatelly now, it is still an issue, but it’s rather related the Shopify Graphql itself, than a Remix template issue.

The exact same error appears on the shopify admin page, that’s why I assume this.

so far nothing usefull found :frowning:

This is due to the application exceeding the rate limit. Please refer to the documentation for more details:

Hello,

I don’t think so.

If we hit the Graphql rate limiter when we run out of the points, we receive an the response by the throtle status this information.

In my example response It is visible that we have used only 10 points from the 2000 so it is not related to that ratelimiter what you linked.

{
cost: {
requestedQueryCost: 11,
actualQueryCost: 10,
‘throttle Status’: {
maximumAvailable: 2000,
currentlyAvailable: 1990,
restoreRate: 100,
},
}

And also we receive this error when I just want to update an email address of this specific order from the Shopify admin page too.

Hi,

Facing the same issue and the same error.
Did you get any solution?

In my testing, it is only if you try to update the order.email.
If I exclude email and update as many times as I want… it’s through!

Not sure but it seems some internal checks are fired and are not related to rate limits surely

Hello Navdeep,

Unfortunately, it is still an issue, so far I found nothing, just after 4 successful API calls it starts giving an error ‘Too many attempts. Please try again later.’

Hi Kapil,

Can you confirm if it is due to order.email?
In my case, it is only an issue if I try updating email and not other properties

I don’t think so as it’s coming in a lot of other API endpoints also, even though you have more points than your request requires.
There is something wrong from Shopify end.

Oh… in my case… it is just email… its strange

Hi @Liam-Shopify

Can you help analyze if this is a bug?

Hey folks,

Trying to pinpoint the exact issue here, to confirm - is this only occurring when editing an order and changing the email? If not, what are the conditions for reproducing this?

@Liam-Shopify

I have encountered this issue, as well.
in my specific case, it is only occurring when editing an order and changing the email. Looking forward to any suggestions you may have!

@Liam-Shopify , did further testing this morning. This is creating new orders for me when I get the error. It’s not the api usage limit (see below). Now in testing I am able to create about 5 orders (creates one every second or two). Then after usually 5 (seems pretty consistent but didn’t check every single test - but every one I do it’s 5) it gets the error (also posting the response body below). I had it pause with different time limits and after reviewing logs it seems to require a full minute pause and then it can go again (tried everything from 2 to 5 to 15 seconds before noticing the 1 minute pattern).

The 1 minute pattern so far in testing is consistent (now run for 10 pause cycles and it always let me continue where shorter never did on next attempt)

If you need any more info, let me know or PM or whatever. Glad to help.

{
  "orderCreate": {
    "userErrors": [
      {
        "field": null,
        "message": "Too many attempts. Please try again later."
      }
    ],
    "order": null
  }
}
{
  "cost": {
    "requestedQueryCost": 21,
    "actualQueryCost": 10,
    "throttleStatus": {
      "maximumAvailable": 2000,
      "currentlyAvailable": 1990,
      "restoreRate": 100
    }
  }
}

@Liam-Shopify just an update on my post above. I didn’t think it would make a difference but I tried running two processes in parallel and it did as expected (still limited to 5 per minute in total between the processes). So one runs and hits the error after 5 calls and the off timed one hits the error immediately.

Yes, I’m back. Found the error happened in my dev store with extended variants preview, but not in the clients soon to be live store. Same data.