A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hi,
I am trying to update Customer with the admin GraphQL API (https://shopify.dev/docs/admin-api/graphql/reference/customers/customerupdate).
it shows Error message of: userErrors":[{"field":["id"],"message":"Cannot specify ID on creation"}]}}
The id I am using is: gid://shopify/Customer/5041754013902
(I can access the customer with the ID through https://chenstoretest.myshopify.com/admin/customers/5041754013902).
Full payload of the shopify customer object:
Can I get some help why it always throws an error with the given ID?
Thanks!
Hey @kevinLi
Happy to help you out with this.
It looks like from the error in the first screenshot, customerCreate is being executed instead of the customerUpdate mutation. Looks like you're using a 3rd party library or perhaps have created your own to assist with utilizing our admin api. If possible, I'd try and do the a customerUpdate from a tool like Insomnia or Postman just to verify the update mutation works.
Let me know how you make out and if you have any other questions.
Regards,
John
John C | Developer Support @ 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