Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Feature]: Import .shopify/metafields.json file in Shopify Admin ? #5173

Open
msev opened this issue Jan 9, 2025 · 2 comments
Open

[Feature]: Import .shopify/metafields.json file in Shopify Admin ? #5173

msev opened this issue Jan 9, 2025 · 2 comments
Labels
Area: @shopify/theme @shopify/theme package issues Type: Enhancement New feature or request

Comments

@msev
Copy link

msev commented Jan 9, 2025

What area(s) will this request affect?

Theme

What type of change do you want to see?

New feature

Overview

Since Shopify CLI 3.73.0, there's a new shopify theme metafields pull command that creates the .shopify/metafields.json file containing the metafields definitions.

Are there any plans to import this file into Shopify admin in the future?

Motivation

This would be very useful when you want to use the same metafields on several stores (for example, a single store owner with several stores) without having to create the definitions manually.

@msev msev added the Type: Enhancement New feature or request label Jan 9, 2025
@aswamy aswamy added the Area: @shopify/theme @shopify/theme package issues label Jan 9, 2025
@rcasimmons
Copy link

This.

This would be a MASSIVE help - especially if we're importing the same set of metafields into different stores.

@aswamy
Copy link
Contributor

aswamy commented Jan 21, 2025

Hello @msev @rcasimmons. Thanks for the interest in this command! Internally, the command just uses the public GraphQL Admin Endpoints which you could use today to upload metafields across shops.

The reason I'd choose this approach over using the metafields CLI command is that the metafields command is used internally for tooling purposes (e.g. code completion). The file will only have a subset of metafield definitions defined on Admin (and is subject to change depending on the tool's needs). The GraphQL queries/mutations are more stable and you should be able to fetch the name, namespace, key, description, and type without running into any permission issues.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Area: @shopify/theme @shopify/theme package issues Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants