I want to remove customer from an order using Graphql. Currently I use admin rest api for this
const { admin, session } = await authenticate.admin(request);
const order = new admin.rest.resources.Order({session: session});
order.id = 450789469;
order.customer = null;
await order.save({
update: true,
});
How can I do this in graphql?
I asked the dev assistant AI in shopify docs, and it gave me this
mutation UpdateOrderCustomer {
orderUpdate(input: {id: "gid://shopify/Order/123456789", customer: null}) {
order {
id
customer {
id
}
}
userErrors {
field
message
}
}
}
But it isn’t working, because there is no param for customer.