Unable to create admin filterable metafield definitions

Topic summary

A developer encountered an error when attempting to enable the admin_filterable capability for metafield definitions via the Shopify Admin API. The error message stated “The capability admin_filterable is not valid for this definition.”

Root Cause:
The capability is only supported for specific metafield data types. The original poster was using number_integer, which is not currently supported. Supported types are documented in Shopify’s help center but not prominently featured in the developer documentation.

Documentation Issues Identified:

  • The dev docs example contains typos: adminFilterStatus (unsupported) and type (not allowed in updates)
  • Supported types list is missing from key API documentation pages
  • Native searchable fields lack clear documentation

Shopify Staff Response:
Confirmed plans to expand supported types (timing TBD) and add the supported types list to the capabilities documentation page.

Additional Feature Requests:

  • Support for number_integer type with comparison operators (less than/greater than)
  • Fix for smartCollectionCondition not applying until save/reload
  • Ability to use metafield values for custom sorting

Unresolved:
Another user reported the same error with “Single line text” (supposedly supported), suggesting possible additional constraints or bugs.

Summarized with AI on October 26. AI used: claude-sonnet-4-5-20250929.

I’m attempting to use the new Admin filterable metafield capability as outlined here: https://shopify.dev/docs/apps/build/custom-data/metafields/use-metafield-capabilities#admin-filterable

However, the API returns this error for all of my attempts:

The capability admin_filterable is not valid for this definition.

Here is an example mutation:

mutation metafieldDefinitionUpdate($definition: MetafieldDefinitionUpdateInput!) {
  metafieldDefinitionUpdate(definition: $definition) {
 userErrors {
   field
   message
 }
 updatedDefinition {
   key
   name
   namespace
   ownerType
   id
   useAsCollectionCondition
   capabilities {
     adminFilterable {
       enabled
         }
       }
     }
  }
}

And here are the variables"

{
  "definition": {
    "namespace": "custom",
    "key": "material",
    "name": "material",
    "ownerType": "PRODUCT",
    "capabilities": {
      "adminFilterable": {
        "enabled": true
      }
    }
  }
}

And this is the response:

{
  "data": {
    "metafieldDefinitionUpdate": {
      "userErrors": [
        {
          "field": [
            "definition"
          ],
          "message": "The capability admin_filterable is not valid for this definition."
        }
      ],
      "updatedDefinition": null
    }
  },

Also note the example in the linked dev doc has two typos that would not work on the 2024-10 API. “adminFilterStatus” is not supported in the response params, and “type” is not allowed in metafield definition updates.

What definition type do you have? The admin filterable capability is only supported by a few of the types right now.

As an aside: we’ll get this list into the dev docs so it’s easier to find (and fixup those errors in the example mutation).

Ah that must be it. I was using “number_integer”. Any chance that is on the roadmap for the near future? My use case is to store product sales rank info. Might be a good idea to list the restriction about types on the https://shopify.dev/docs/api/admin-graphql/2024-10/mutations/metafieldDefinitionUpdate and https://shopify.dev/docs/apps/build/custom-data/metafields/use-metafield-capabilities#admin-filterable docs too. Thanks!

1 Like

We’ll expand the types supported — just timing and priorities :grin:

We’ll add the supported types to the capabilities page; feels like the natural home to me.

Excellent, thanks Jesse! I can appreciate needing to time and prioritize things :slightly_smiling_face: I hope to see number_integer in the near future, ideally with support for less than and great than options in addition to the current checkbox “is equal” version.

Also, fyi the smartCollectionCondition works great, but one thing that seems off is the condition is not applied until you save and reload or come back into the collection. Perhaps that is already on your radar, but wanted to mention it in case you were not aware.

And lastly, one capability that’d be super powerful is the ability to use a metafield value for custom sorting, in case you don’t have that on your list yet.

Thanks again!

  • Tom
1 Like

Yes, please expand the types available for the filtering.
Also, a bit of off-topic but:
It would be great to understand which fields can be used natively (https://shopify.dev/docs/api/usage/search-syntax)
title, created_at, orders_count, first_name, where can I check which fields are available?

I am getting the same error on the admin UI interface when trying to make an existing metafield filterable

“Single line text” is supported metafield type as per the docs. Am I missing something?