graphql to get category/taxonomy metafield list base on taxonomy id

Topic summary

A developer is building a Shopify product integration via GraphQL and needs to programmatically retrieve category-specific metafield definitions based on taxonomy/category ID.

The Challenge:

  • When creating products with specific categories (e.g., “Shirts”), they can see category attributes like “Color” in the taxonomy
  • However, they cannot determine the corresponding metafield namespace and key (e.g., namespace="shopify", key="color-pattern") needed for the createProduct mutation
  • While the Shopify UI displays these metafields automatically (as shown in the attached screenshot), there’s no clear GraphQL query to retrieve this mapping programmatically

What They Need:
A GraphQL query that returns the list of metafield definitions (namespace/key pairs) associated with a specific taxonomy/category ID, similar to what appears in the Shopify admin interface.

The discussion remains open with no responses or solutions provided yet.

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

We are building an integration to create products through the GraphQL API. When creating a product, we want to also add data for the category-specific metafields but we are having trouble getting the specific metafields for a product based on its category.
As an example, let’s say we want to create a product with the “Shirts” category. We would find the specific category in the taxonomy and look at the attributes. We see the “Color” attribute and we would like to send a value for that.
But from this point, we have no way to determine which metafield namespace and key we need to use in the “createProduct” mutation to populate that value. For this specific example, we know that namespace=“shopify” and key=“color-pattern” but we need to be able to do this automatically.

in UI we get list of metafield similarly we need it from graphql

Thanks for your help!