Checkout validation function query input variables

Topic summary

Main issue: Passing a shop metafield as a query input variable to a Shopify Checkout Validation function fails. The variable ($protectedCollectionsIds) intended for product inAnyCollection(ids: $protectedCollectionsIds) remains null, causing inAnyCollection to return False.

Setup: The app sets a shop-level metafield via metafieldsSet (ownerId = Shop GID, type json) and configures the function with [extensions.input.variables] using the same namespace/key. The metafield is readable in the query under shop, but the input variable itself isn’t injected.

Observed behavior: If a default value is hardcoded in the GraphQL query (e.g., [“gid://shopify/Collection/477600842047”]), inAnyCollection returns True as expected. The same variable approach works in Discount Functions.

Update/clarification: A response cites a Shopify community thread indicating input variables are not yet supported for Cart/Checkout Validation functions.

Outcome: This is a current platform limitation, not a misconfiguration. No full workaround beyond hardcoding defaults or avoiding variable-based injection in Checkout Validation. Status: unresolved/awaiting platform support.

Summarized with AI on December 27. AI used: gpt-5.

Hello, i’m trying to use checkout validation function with query input variables as it described in the docs
https://shopify.dev/docs/apps/functions/input-output/variables-queries

First of all, there is absolutely unclear information about how to find ownerID. But as i’ve reed on the community forum - Shop is the owner.
But it doesn’t work, i see metafields in the shop, but inAnyCollection filter still return False, when True is expected

Here is a quick sample for it
Query Input (run.graphql)
query RunInput($protectedCollectionsIds: [ID!]) {
cart {
lines {
merchandise{
__typename
… on ProductVariant {
id
product {
id
inAnyCollection(ids: $protectedCollectionsIds)
}
}
}
}
}
shop{
protectedCollectionsIds: metafield(namespace: “$app:nifty-bridge”, key: “protectedCollectionsIds”){
value
}
}
}

Function config(shopify.extension.toml)

[extensions.input.variables]
namespace = “$app:nifty-bridge”
key = “protectedCollectionsIds”

MetaieldsSet input
{
key: “protectedCollectionsIds”,
namespace: $app:${METAFIELDS_NAMESPACE},
ownerId: shopifyShopGId,
type: “json”,
value: JSON.stringify({ protectedCollectionsIds }),
}

Output
i can receive protectedCollectionsIds in the shop metafields

shop{
“protectedCollectionsIds”: { “value”: “{"protectedCollectionsIds":["gid://shopify/Collection/477600842047"]}” }
}

But inAnyCollection in input still False for the product

If i will set default value for $protectedCollectionsIds from metafields
query RunInput($protectedCollectionsIds: [ID!]=[“gid://shopify/Collection/477600842047”])

inAnyCollection will be True, as expected

Can someone help me to figure out how to work with it?
I’ve tried with discount functions and it works as expected.

Well apparently it’s not yet possible to use input variables in the checkout validation, see here.
I have a similar issue where I’m setting a metafieldsSet with shop id and a JSON but my variable input is marked as null where its working well with discount.