How to query shopify collections data according to metafields key and value using admin graphql api

i am having trouble getting collection in respect to metafields key or value

query GetCollections{
  	collections(first:20, query: "metafields:namespace.key='parent'" ){
      nodes{
        id
        handle
        title
        metafields(first:10){
          nodes{
            key
            value
            namespace
          }
        }
      }
    }
}

Hey @AmitIntuji ,

Looking over our documentation here, metafields is not an available filter query on collections.

You can see the available filters here: https://shopify.dev/docs/api/admin-graphql/2024-01/queries/collections#argument-collections-query

The unstable API version does have a metafields query. There’s an example here on retrieving metafields within a namespace.

Hope that helps!

  • Kyle G.