Access the customer tags inside shopify function but this function is for multiple retailers

Topic summary

A developer is building a multi-tenant Shopify app with a cart transform function that needs to check customer tags. The challenge is that the function’s GraphQL query parameters are app-wide rather than vendor-specific.

Current Issue:

  • The $customerTag parameter in the input query applies globally across all retailers
  • Different vendors require different customer tag configurations
  • Need a way to parameterize the query based on individual vendor requirements

Proposed Solution:
One respondent suggests using app metafields to store vendor-specific customer tags. This approach would:

  • Store each vendor’s customer tags in metafields
  • Reference those metafields in the input query
  • Allow per-vendor customization while maintaining a single function

Status: The discussion remains open with one potential solution offered but not yet confirmed as implemented or tested.

Summarized with AI on November 1. AI used: claude-sonnet-4-5-20250929.

I am building one app which can be used by multiple retailers. And in that app there is one function called cart transform. Inside that function I want to access the customer tags or know whether a customer has particular tags. I know how to parameterise the input of the graphql query. But when you create/register this function this parameter is not as per the retailers. This is a complete list of tags that is published to my app and that is running for all the customers. But I want to parameterise this query based on the vendor. For different vendors the customer tags would be different. How to achieve that?

query RunInput($customerTag: [String!]) {
  cart {
    buyerIdentity {
      customer {
        amountSpent {
          amount
        }
        hasTags(tags: $customerTag) {
          hasTag
          tag
        }
      }
    }
  }
}

I think you need to use app metafields to store the customer tags for each vendor. Your input uses the customer tag saved in the metafield. See here for more info: Metafields for input queries