Hey everyone, I’m attempting to mutate customAttributes on the orderUpdate mutation.
https://shopify.dev/docs/admin-api/graphql/reference/mutation/orderupdate
It has the option to mutate customAttributes as shown here:
| customAttributes ([AttributeInput!]) | Custom information to add to the order, represented as a key value pair. Also referred to as note attributes. |
|---|
When I mutate, it deletes all existing customAttribute key value pairs, and writes the key value pair from my query variables. Is there any way to only change that one key value pair without deleting the others?
Do i need to dynamically grab ALL the customAttributes and use them as my variables?
I am very new to graphQL, please school me if my mutation is just plain wrong!
Here is my query and variables:
mutation orderUpdate($input: OrderInput!) {
orderUpdate(input: $input) {
order {
id
customAttributes {
key
value
}
}
userErrors {
field
message
}
}
}
{
"input":{
"id": "gid://shopify/Order/theordernumber",
"customAttributes": {
"key": "Checkout-Method",
"value": "delivery"
}
}
}