Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Is this an intended change? Metafields can no longer be queried as a list for a product or variant?
Theres no mention of this in the CHANGELOG..
I'm now seeing this in my queries that haven't changed since a week ago...
Field 'edges' doesn't exist on type 'Metafield'
Field 'metafields' doesn't accept argument 'first'
Field 'metafields' is missing required arguments: identifiers
Yep, I'm experiencing this as well.
According to the release candidate version of the API, you have to now pass a list of Identifiers.
https://shopify.dev/api/storefront/2022-07/objects/Product
Not sure how this needs to be formatted though. I'm actually trying to adjust my graphql to make it work right now.
I've just ran into the same issue. Reverted to the 2022-04 storefront api for now but can't find any info on this. Have you found anything ?
Actually, just noticed that it is in the release notes
As of API version 2022-07, the HasMetafields.metafields paginated connection in the Storefront API is deprecated. Previously, this connection enabled you to paginate over all visible metafields in a given resource.
HasMetafields.metafields now accepts a list of metafield namespaces and keys, and returns a list of associated metafields that match the given namespaces and keys.
For more information, refer to the HasMetafields interface.
Also had some trouble with this. Found the format after a bit of troubleshooting.
metafields(identifiers: [
{namespace: "your-namespace", key: "your-key"},
{namespace: "your-namespace", key: "your-key"},
]) {
type
namespace
key
... whichever fields you want to return
}
Is this something that will work if you wanted to list out all metafields on the front-end of your site? So the idea would be that you could list out metafields and their values to be used in search functionality