Liquid, JavaScript, themes, sales channels
I am running the following graphql query to obtain products and their metafields:
query productsByMasterTag($query: String!) {
products(first: 28, query: $query) {
edges {
node {
tags
metafields(first:15) {
edges {
node {
value
key
namespace
}
}
}
images(first:15) {
edges {
node {
originalSrc
}
}
}
}
}
}
}
When I run this from our front-end web app, we only receive a maximum of 6 metafields on each product, despite having 9 or more on many. When I run this same query in the Shopify GraphQL app, it returns all 9 or more metafields on each product.
Is there some kind of limitation or permission that I need set to return more than 6?
Also note that we have two stores (dev and production), and our production store does not exhibit the issue (returns all metafields on each product).
I think I've solved this myself. We were importing our product data using excelify, and the new product metafields weren't showing up in the graphql responses. It appears we needed to run a graphql mutation to set the metafield visibility. Here's what I ran:
mutation ($input: MetafieldStorefrontVisibilityInput!) {
metafieldStorefrontVisibilityCreate(input: $input) {
metafieldStorefrontVisibility {
id
}
userErrors {
field
message
}
}
}
with input params:
{
"input": {
"namespace": "product",
"key": "compatibility",
"ownerType": "PRODUCT"
}
}
Thanks to this post:
Hey @wildabeast
Renars here from Matrixify (ex Excelify).
Thank you for mentioning us and sorry to hear about the trouble.
I have noted this issue in our future developments list to develop the ability in the app to bulk adjust the storefront visibility for Metafields.
Glad to hear that solution is found for now! 🙂
Sorry I made a mistake -- these records were imported through celigo rather than excelify.
User | RANK |
---|---|
35 | |
25 | |
14 | |
13 | |
9 |
Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023