Hi,
I am trying to update the deposit percentage as part of the buyerExperienceConfiguration on company location.
I’m not a specialist of graphQL yet. I first tried something simple which was
{
"query": "mutation UpdateCompanyLocation { companyLocationUpdate(companyLocationId: \"gid://shopify/CompanyLocation/1479934290\", input: { buyerExperienceConfiguration: { deposit: { percentage: 20 } } }) { companyLocation { id buyerExperienceConfiguration { deposit { ... on DepositPercentageConfiguration { percentage } } } } userErrors { field message code } } }",
"variables": {
"companyLocationId": "gid://shopify/CompanyLocation/1479934290",
"depositPercentage": 20
}
}
But this returned an error [200] “Error(s): selectionMismatch - Selections can’t be made directly on unions (see selections on DepositConfiguration)”
Then the AI Shopify developer assistant suggested me to use an “inline fragment” and to try this instead :
mutation UpdateCompanyLocation {
companyLocationUpdate(
companyLocationId: "gid://shopify/CompanyLocation/1479934290",
input: {
buyerExperienceConfiguration: {
deposit: { percentage: 20 }
}
}
) {
companyLocation {
id
buyerExperienceConfiguration {
deposit {
... on DepositPercentageConfiguration {
percentage
}
# Add other fragments here if you want to handle other deposit types
}
}
}
userErrors {
field
message
code
}
}
}
But that doesn’t work either, I get this error : “[200] Error(s): undefinedType - No such type DepositPercentageConfiguration, so it can’t be a fragment condition”
Anyone could help me getting my mutation right please?
Thanks.