Repository navigation
[RFC] application/metafield-edit: stage a bulk change of metafield values that the merchant previews before it is written #75
samuelbelolo
started this conversation in
RFC
Replies: 1 comment
|
Hey! Thanks for the proposal. We have a little bit of a backlog but we'll be taking a closer look into it asap. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
1. What type are you proposing?
application/metafield-edit, withcreateandedit.A metafield edit is a change of metafield values across many store resources at once: one metafield (or a few) on the
products, variants, collections, customers, orders, companies, locations or markets the merchant picks, with the new
value of each. The app stages it as a preview, every value before → after, the values its definition would refuse
marked, and writes it only when the merchant applies it. Once applied it can be undone. An app may also run it later
(a scheduled edit) or keep it applied as new resources match (a rule).
It is not the editing of one resource's metafields on its own admin page, which Shopify's admin already does, nor a
metafield definition (the schema), which Shopify's settings own.
2. What do merchants ask Sidekick to do that needs it?
The core tasks of our grid, as a merchant would ask Sidekick:
create)create)create)create)edit)Today Sidekick can answer some of these one resource at a time, or not at all for owner types outside the admin's bulk
editor (orders, companies, locations, markets). The app already does each in its grid, with a preview and an undo.
Without a type, our only route from Sidekick is a text link to the grid: the outline Sidekick built is lost, the
merchant rebuilds it by hand, and no result returns to Sidekick.
3. What apps would register intents for it?
carry
mimeType: "application/metafield-edit"so "open the one from yesterday" routes toedit.only): Metafields Guru, Ablestar Bulk Product Editor, Accentuate Custom Fields, and spreadsheet-style editors.
createfor a change too large to type, handing over the same outline.4. What fields does it need?
An outline Sidekick can prefill, in the shape of
application/comparison-table: the identity, which resources, whichmetafield, and the change. No
required,additionalProperties: true.{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://extensions.shopifycdn.com/shopifycloud/schemas/v1/application/metafield-edit.json", "title": "Metafield Edit Schema", "type": "object", "properties": { "id": { "type": "string", "description": "The staged edit's ID, used when editing an existing edit" }, "ownerType": { "type": "string", "description": "The kind of resource whose metafields change, as the Admin API's MetafieldOwnerType names it, for example PRODUCT, PRODUCTVARIANT, ORDER or COMPANY" }, "owners": { "type": "array", "description": "The resources to change, as GIDs", "items": { "type": "string" } }, "definition": { "type": "string", "description": "The metafield to change, as a MetafieldDefinition GID or as namespace.key" }, "value": { "type": "string", "description": "The new value for every owner, serialized as the Admin API's metafield value for the definition's type" } }, "additionalProperties": true }How the app selects resources beyond a list (a collection, a search, "every matching"), its operations (find and
replace, a formula, clear), schedules and rules stay app-specific in each app's
inputSchema.Example invocation:
The app opens its preview with that outline. Nothing is written until the merchant applies it in the app. For
edit,the staged edit's identity is the top-level
value(gid://application/metafield-edit/<id>).5. Anything close in the existing list?
application/product-specificationshopify/Product(import+bulk)application/optimization-planapplication/change-history6. Questions for maintainers
shopify/type (asshopify/content-localization), or as an app-ownedapplication/type since the staged edit is the app's record?application/metaobject-entry-edit?definition+valuethe right shared core, with several metafields per edit leftto
additionalProperties?Happy to open the PR with the type file once the direction is agreed, and to test it on our development app before
release.
Optional: a comment on RFC #55
application/change-historyNative Metafields keeps the same kind of record for custom data (every metafield and metaobject entry change, in the app
or outside it, before → after, with its author and an undo), so it would register
editon #55 too. A short supportingcomment, for Samuel to post if he wants:
All reactions