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

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!