Ecommerce Shopify WordPress Discussion

shopify functions – variables not working with shop metafield

I need to use variable for tag ids and collection ids. I have created metafield on "shop" and set the values for Here is the doc https://shopify.dev/docs/apps/functions/input-output/variables-queries` But unfortunately it is not picking up the variable values. query RunInput( $selectedCollectionIds: [ID!] $selectedProductTags: [String!] ) { cart { lines { quantity merchandise { __typename ... on ProductVariant { id weight product { isGiftCard inAnyCollection(ids: $selectedCollectionIds) inCollections{ __typename collectionId isMember } hasAnyTag(tags: $selectedProductTags) hasTags(tags:$selectedProductTags){ __typename hasTag tag } } } } } } shop{ metafield( namespace: "$app:my_namespace" key: "my_key" ) { value } } } According to the doc added the variable name in .toml file as well. api_version = "2023-10" [[extensions]] handle = "my-app" name = "t:name" description = "t:description" type = "function" [[extensions.targeting]] target = "purchase.validation.run" input_query = "src/run.graphql" export = "run" [extensions.input.variables] namespace = "$app:my_namespace" key = "my_key" [extensions.build] command = "" path = "dist/function.wasm" [extensions.ui.paths] create = "/" details = "/" Here is the metafield value that was created on shop resource { id: 35171720954165, namespace: '$app:my_namespace', key: 'my_key', value: '{"selectedProductTags":[],"selectedCollectionIds":["gid://shopify/Collection/442796769589","gid://shopify/Collection/442796704053","gid://shopify/Collection/442796802357"]}', description: null, owner_id: shopId, created_at: '2023-10-16T00:59:56-04:00', updated_at: '2023-10-16T03:31:01-04:00', owner_resource: 'shop', type: 'json', admin_graphql_api_id: 'gid://shopify/Metafield/3517172095416 }
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.