{
  "slug": "shopify-app-function-target-level-input-variables-1fcf69de3ff2",
  "title": "shopify app function target-level input variables",
  "tools": [
    "shopify"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-10-08T13:19:12.000Z",
  "announced_at": "2026-10-08T13:19:12.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When a function target’s input query declares variables, set `input_variables` on that target to identify its JSON metafield. Don’t also configure extension-level variables in the same function.",
    "examples": [
      "[[extensions.targeting]]\ntarget = \"<function-target>\"\ninput_query = \"<path-to-input-query.graphql>\"\ninput_variables = { namespace = \"$app:<namespace>\", key = \"<key>\" }\nexport = \"<function-export>\""
    ],
    "gotchas": [
      "Version: 4.9.0",
      "input_variables (required): Target-level setting for the metafield used to populate that target’s query variables; required when the query declares variables.",
      "input_variables.namespace (required): Metafield namespace.",
      "input_variables.key (required): Metafield key.",
      "[extensions.input.variables]: Extension-level variable placement; cannot be combined with target-level `input_variables` in the same function. For older configuration files without `[[extensions]]`, the section is `[input.variables]`.",
      "Prerequisite: Shopify CLI 4.9.0 or higher.",
      "Prerequisite: The referenced metafield must be JSON type; set it on the function owner.",
      "Target-level and extension-level variable placements cannot be mixed."
    ]
  },
  "why_it_matters": "Configure different input query variables for targets in a Shopify function extension.",
  "before": "Extension-level `[extensions.input.variables]` applied one metafield to every target; older configuration files used `[input.variables]`.",
  "sources": [
    "https://github.com/Shopify/cli/releases/tag/4.9.0",
    "https://github.com/Shopify/cli/pull/8471",
    "https://shopify.dev/docs/apps/build/functions/input-queries/use-variables-input-queries"
  ],
  "rank": 0.97028,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave2a-20261017",
    "verdict_id": "wave2a-20261017:wave2a-20261017-ace6dac0a81fcc98-4:gate",
    "evidence_hash": "2be2cd26171dc505b293189ca2260f6b657c87e29250c8d3dad5dbd276d4532c"
  },
  "review": {
    "draft_hash": "91d97cfdfcffc37716589a0c00cfef69362560dff031974a63205253630404ab",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-08T13:19:12.000Z",
    "decision": "wave2a-20261017:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.97 >= 0.9; 2 needed) and Jev gave 0.73 (>= 0.6 needed)."
  }
}
