Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

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

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

Already on GitHub? Sign in to your account

Non product and collection metafields? #32071

Closed
dungle-scrubs opened this issue Jun 13, 2021 · 6 comments
Closed

Non product and collection metafields? #32071

dungle-scrubs opened this issue Jun 13, 2021 · 6 comments
Labels
type: question or discussion Issue discussing or asking a question about Gatsby

Comments

@dungle-scrubs
Copy link

Is there already, or will there at some point be access to all types of metafields? For example, I use an app called Custom Fields by Bonify and they offer a global metafield section. I like it because it allows for arrays of product or metafield references (JSON stringified array of handles) which are really simple for the client.

Searching through allShopifyMetafieldInterface, I don't see the global metafields I've created, so am just wondering if they are limited to products and collections for now.

As a use-case, I think globals would be really nice for certain types of site configuration with headless shops.

Cheers!

@sslotsky
Copy link
Contributor

Do you know if these global metafields are available through the admin API?

We currently pull down metafields for products, product variants, and collections. Within Gatsby these each have their own types, but they also implement a common interface which is what allows them to be retrieved by allShopifyMetafieldInterface. So if there are other resources that have metafields, we could pull those down as well and add them to the interface. But I'm not currently seeing anything in the admin API that allows us to pull down these global metafields (I might be missing it though)

@dungle-scrubs
Copy link
Author

@sslotsky Ah okay, thanks, that makes sense. I'm assuming that the metafields I'm referring to are available through the Admin API as Shop.metafields, which this plugin isn't pulling in.

From the docs, the complete list of Types that return metafields are

Collection.metafield
Collection.metafields
Customer.metafield
Customer.metafields
DraftOrder.metafield
DraftOrder.metafields
Image.metafield
Image.metafields
Order.metafield
Order.metafields
Product.metafield
Product.metafields
ProductVariant.metafield
ProductVariant.metafields
Shop.metafield
Shop.metafields

@sslotsky
Copy link
Contributor

I'll have to double check this but my recollection is that we couldn't get the shop through the bulk API because it only allowed us to request connection data at the top level. But maybe there are other ways to get at those shop.Metafields. Thanks for assembling this information.

@dungle-scrubs
Copy link
Author

You're welcome. And the Admin API can still be pinged separately in gatsby-node.

@sslotsky
Copy link
Contributor

It certainly can. We are just cautious about having more than one way to source the data without at least understanding your use cases first. The logic to consume the regular admin API vs the bulk API is quite different.

@dungle-scrubs
Copy link
Author

Thanks, I think my use-case is way too specific to make that worthwhile. In most cases with a headless shop, shop-owner-configurable site-wide settings can be handled via a CMS.

@DanielSLew DanielSLew transferred this issue from gatsbyjs/gatsby-source-shopify Jun 23, 2021
@gatsbot gatsbot bot added type: question or discussion Issue discussing or asking a question about Gatsby status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jun 23, 2021
@LekoArts LekoArts removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jun 23, 2021
@gatsbyjs gatsbyjs locked and limited conversation to collaborators Jun 23, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
type: question or discussion Issue discussing or asking a question about Gatsby
Projects
None yet
Development

No branches or pull requests

3 participants