A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hi!
I use API to create a product but there is an issue with meta fields. For some reason, they are not set up.
What am I doing wrong?
Hi @iamarsibragimov 👋
It's likely that `global` is not the correct namespace for the `ispattern` metafield from your screenshot. If you click text field for `ispattnern` in the Admin UI, there should be a link to its "Definition" that includes it's namespace.
Alternatively, you can use the following GraphQL query for `MetafieldDefinitions`:
{
metafieldDefinitions (ownerType: PRODUCT, first:100) {
nodes {
name
namespace
key
}
}
}
Hope that helps!
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Thx for the answer. Where can I find def in Admin UI? I only see this
Hey @iamarsibragimov,
Great question. If you favor working with metafields in the admin over the API or are cross-referencing how this will look in the admin - we offer a detailed guide in our help docs working with Metafields here. The screenshot shared in your last post is the metafields definition available through the admin.
There is also a dedicated section in our docs on editing a definition through the admin that includes a few insights, such as follows:
You can only edit custom metafield definitions. Standard metafield definitions are automatically configured for you and they can't be edited.
For any other questions or concerns around using the admin features available, don't hesitate to connect with Shopify Support here or consider posting in the Technical Q&A community board here.
If you are looking for additional insights into working with metafields using the API, after reviewing our extensive developer resources we'd suggest bringing additional questions back to this community board.
- Cheers!
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog