GraphQL: Update one address field using MailingAddressInput

kevinLi
New Member
4 0 0

Hi,

 

I am using MailingAddressInput to update one field in address. For example, if I only specify "address1" in the payload, the other fields will lost. Semmes like it assumes the fields that are not specified to be empty. I am wondering  if it's possible to only update the specified field and keeps the other fields as they were?

https://shopify.dev/docs/admin-api/graphql/reference/common-objects/mailingaddressinput

Sample Payload:

{
"query":"mutation customerUpdate($input: CustomerInput!) { customerUpdate(input: $input) { customer { id } userErrors { field message } } }",
"variables":{
"input":{
"id":"gid://shopify/Customer/4454729220306",
"acceptsMarketing":false,
"addresses":[
{
"address1":"15 queens XX",
"city":"TorontoX"
}
]
}
}
}

0 Likes