Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I want to remove a customer from an order using GraphQL. Currently, I'm using the Admin REST API for this:
const { admin, session } = await authenticate.admin(request); const order = new admin.rest.resources.Order({ session }); order.id = 450789469; order.customer = null; await order.save({ update: true });
This works fine using the REST API, but I can't find the equivalent way to do this with GraphQL. Specifically, I tried the following mutation suggested by the Shopify docs assistant AI:
mutation UpdateOrderCustomer { orderUpdate(input: { id: "id", customer: null }) { order { id customer { id } } userErrors { field message } } }
However, this doesn't work because the customer parameter is not valid for the orderUpdate mutation.
How can I achieve this in GraphQL?
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025