[Metafields] admin.metafields.options.data target - #4609
Draft
philmongeon wants to merge 1 commit into
Draft
Conversation
Contributor
|
This PR targets a stable release branch ( When you open the forward-port PR, include a line like this in its body so the Accepted formats (comma-separated for multiple):
If a forward-port isn't needed (e.g., the change is stable-only), you can remove the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
Part of the dynamic metafield options initiative, which lets an app supply live, presentation-only options for its own metafield definitions in Admin's native metafield editors — without persisting a
choicesvalidation that goes stale, and without rebuilding the editor as custom app UI.Today, apps can create metafield definitions but can't influence how merchants fill them. Anything dynamic (a live catalogue, an ERP list, an external taxonomy) has to be frozen into
choicesvalidations or rebuilt as a custom UI. The new runnable target closes that gap: the app returns option lists, and Admin keeps rendering, validating, and saving.Related work:
MetafieldDynamicOptionsDataschema group,internal: true,minimum_api_version: 2026-10): shop/world#983629admin.<area>.<thing>.data—admin.metafields.options.dataTarget strings are permanent, so this was settled before publishing.Solution
Declares the client contract for
admin.metafields.options.data:MetafieldOptionsApi— extendsStandardApiwithdata: MetafieldOptionsData, carrying theownerresource being edited (global ID + owner type;idisnullfor unsaved resources) andmetafields, the definitions Admin is rendering. Only definitions owned by the calling app are ever included — enforced in Core at the sandbox boundary, asserted by tests in shop/world#949756.MetafieldOptionsOutput—{metafields: [{namespace, key, options}]}: option lists keyed by namespace/key. Options are presentation guidance only: not persisted aschoicesvalidations, no change to save-time enforcement, a saved value stays visible if the provider stops returning it, and entries for definitions not indata.metafieldsare ignored. Supported definition types:single_line_text_fieldandlist.single_line_text_field.@privatewhile Core gates it to Shopify-owned apps.Also adds a
createMetafieldOptionsMockfactory (plus test) inui-extensions-tester, whose factory map requires an entry per target.Includes a
minorchangeset for@shopify/ui-extensions.🎩
Checklist
@publicDocson all new types; target itself is@privatewhile gated)Notes for reviewers:
2026-07because no2026-10branch has been cut yet — may need to be retargeted once one exists.2026-10API version floor (currently validates only onunstable).