Tags:
- Admin GraphQL API
Support added for $app in product queries by metafield
We now support querying products by app-owned metafields with a saved namespace using the $app syntax. To include an app-owned metafield in your query, you can use the syntax metafields.$app.key:\"value\" or metafields.$app\\:optional-additional-text.key:\"value\".
As documented, special characters need to be escaped from queries. For this reason, you need a \\ when specifying :. For example, suppose you have an app-owned metafield with the optional-additional-text swatch-app and key color with a value of green. To query for products with this metafield, you would use the following search syntax:
"metafields.$app\\:swatch-app.color:\"green\""
Learn more about querying products by metafield value and creating metafields with reserved namespaces.