Setting adminFilterable for metafield definition fails to complete

When enabling the option to allow using a metafield definition to filter products, if you enable it from the Shopify admin, it usually enables almost immediately.

However, when doing it from the API, it stays pending indefinitely. I waited overnight and it still didn’t finish.

 mutation UpdateMetafieldDefinition($definition: MetafieldDefinitionUpdateInput!) {
    metafieldDefinitionUpdate(definition: $definition) {
      updatedDefinition {
        id
        capabilities {
          adminFilterable {
            eligible
            enabled
            status
          }
        }
      }
    }
  }
variables: {
  definition: {
    ownerType,
    namespace,
    key,
    capabilities: { adminFilterable: { enabled: true } },
  }
}


Can you share the store where this is happening @DavidT ?

Sure, it’s “thesecuritydev-test-1.myshopify.com” (I originally created it for bug bounty testing).

Thanks - digging into this now.

I tried enabling it again from the API when I replied, and I just checked and it did actually complete this time. So I disabled and am trying again, but it’s been a few minutes with no change so far, like before.

One further thing is it does work if I create the definition from the API with the adminFilterable enabled during creation.

Hi again @DavidT

It does look like this was a temporary issue with this specific store. Our team were able to re-run the task and reenable it on the metafield definition. You shouldn’t have any issues with that mutation moving forward.

Except it doesn’t seem to be a temporary issue. It happens repeatedly. I just tried it again and it still doesn’t work.

Checking this out on our side

One further thing is it does work if I create the definition from the API with the adminFilterable enabled during creation.

So to confirm it doesn’t work when metafield was created just through the admin and when metafield was created via API but adminFilterable disabled during creation?

This does look like a bug on our side @DavidT - will update here when I have more info.

1 Like

So to confirm it doesn’t work when metafield was created just through the admin and when metafield was created via API but adminFilterable disabled during creation?

Correct.