Hi everyone ![]()
I’m encountering an issue where the metaobjectUpsert mutation consistently fails with an INTERNAL_SERVER_ERROR immediately after reinstalling app — even though the metaobject definition is successfully recreated during the reinstall process.
Mutation Used
mutation metaobjectUpsert($handle: MetaobjectHandleInput!, $metaobject: MetaobjectUpsertInput!) {
metaobjectUpsert(handle: $handle, metaobject: $metaobject) {
metaobject {
id
handle
type
}
userErrors {
field
message
code
}
}
}
Error Response
{
"errors": [
{
"message": "Internal error. Looks like something went wrong on our end.\nRequest ID: xxxx-xxx-xxxx (include this in support requests).",
"extensions": {
"requestId": "xxxx-xxx-xxxx",
"code": "INTERNAL_SERVER_ERROR"
}
}
],
"data": null
}
What I’ve Checked
-
The app is reinstalled and reauthorized successfully.
-
The
$app:definition_keymetaobject definition is recreated during reinstall. -
All required scopes (
write_metaobjects, etc.) are granted. -
The mutation works perfectly before uninstalling the app.
-
Other GraphQL mutations work fine after reinstall.
My Observation
Even after recreating the $app: metaobject definition, running metaobjectUpsert using the same handle (for example, shop-settings) immediately returns an INTERNAL_SERVER_ERROR.
It looks like Shopify might be treating the old handle as stale or invalid due to internal reference cleanup that happens when the app is uninstalled.
Questions
-
Does
metaobjectUpsertblock reuse of handles that existed before reinstall, even if the definition has been recreated? -
Could this be a timing issue — i.e., the definition needs to propagate before the handle can be reused?
-
Are there known workarounds for handling the same
$app:handle after reinstall (like explicitly deleting old instances before re-creating)?
Any guidance or similar experiences would be greatly appreciated! ![]()