Hi,
I want to mutate the customer address with graphql. It needs to do one query to get the address id for the customer, then use the id to update the address. I am wondering if it is possible to combine two query into one.
Query to get address ID:
{customers(first: 1, query: "id:'5044061470926") {
edges {
node {
addresses{
id
}
}
}
}
}
Query to use the ID for mutation (The id in address is the result from the previous query):
{
"query":"mutation customerUpdate($input: CustomerInput!) { customerUpdate(input: $input) { customer { id } userErrors { field message } } }",
"variables":{
"input":{
"id":"gid://shopify/Customer/5044061470926",
"addresses":[
{
"id":"gid://shopify/MailingAddress/6210806939854?model_name=CustomerAddress",
"address1":"15 queens 22",
}
]
}
}
It struggled me for a long time.. Is there a way to combine them into one?
Thanks a lot!