I’m trying to update a shop’s name/title via the Admin API GraphQL mutations, but running into issues. I’ve tried several approaches, all resulting in different errors.
I am using API Version 2024-10
Here’s what I’ve attempted:
Attempt 1: Using shopUpdate
mutation
mutation UpdateShopName {
shopUpdate(input: { name: "New Shop Name" }) {
shop {
name
}
userErrors {
field
message
}
}
}
Error:
{
"errors": [
{
"message": "Field 'shopUpdate' doesn't exist on type 'Mutation'",
"locations": [{"line": 2, "column": 11}],
"extensions": {
"code": "undefinedField",
"typeName": "Mutation",
"fieldName": "shopUpdate"
}
}
]
}
Attempt 2: Using variables with shopUpdate
mutation UpdateShopName($input: ShopInput!) {
shop(input: $input) {
shop {
name
}
userErrors {
field
message
}
}
}
Error:
{
"errors": [
{
"message": "ShopInput isn't a defined input type (on $input)",
"locations": [{"line": 1, "column": 25}],
"extensions": {
"code": "variableRequiresValidType",
"typeName": "ShopInput",
"variableName": "input"
}
},
{
"message": "Field 'shop' doesn't exist on type 'Mutation'",
"locations": [{"line": 2, "column": 11}],
"extensions": {
"code": "undefinedField",
"typeName": "Mutation",
"fieldName": "shop"
}
}
]
}
Attempt 3: Using shopSettingsUpdate
mutation updateShopSettings {
shopSettingsUpdate(input: { name: "New Shop Name" }) {
shop {
id
name
}
userErrors {
field
message
}
}
}
Error:
{
"errors": [
{
"message": "Field 'shopSettingsUpdate' doesn't exist on type 'Mutation'",
"locations": [{"line": 2, "column": 11}],
"extensions": {
"code": "undefinedField",
"typeName": "Mutation",
"fieldName": "shopSettingsUpdate"
}
}
]
}
What works (but not what I need)
The only thing that works is updating the SEO title via metafields:
mutation metafieldsSet($metafields: [MetafieldsSetInput!]!) {
metafieldsSet(metafields: $metafields) {
metafields {
id
namespace
key
value
}
userErrors {
field
message
}
}
}
With variables:
{
"metafields": [
{
"ownerId": "gid://shopify/Shop/7634793",
"namespace": "global",
"key": "title_tag",
"value": "New Shop Name"
}
]
}
This successfully updates the SEO title, but I also need to update the shop name that appears in the Shopify admin preferences (Online Store > Preferences).
Questions:
- What is the correct mutation to update a shop’s name in the admin preferences?
- Are there any specific scopes required for this operation? I currently have write_content, write_products, read_content, read_products, read_translations but none of these seem to work
- Is there a different API version I should be using? (Currently using 2024-10)
Any help would be greatly appreciated!
Additional Context:
- Using the Admin API via GraphQL
- Access token has write permissions
- Successfully able to update other shop settings
- API Version: 2024-10