Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I created some Metafields for Blog Posts and have them populated. I'm building a Hydrogen Shopify storefront and using GraphQL to fetch that blog/article data. But I can't seem to figure out how to get all the metafields. Seems like 'metafield' and 'metafields' only return a single field based on key and namespace. Is there a way to more than one?
query Blog($language: LanguageCode, $blogHandle: String!, $first: Int, $last: Int, $startCursor: String, $endCursor: String) @inContext(language: $language) { blog(handle: $blogHandle) { title seo { title description } articles( first: $first last: $last before: $startCursor after: $endCursor reverse: true ) { nodes { ...ArticleItem metafields(identifiers: {namespace: "custom", key: "misc_content_long_text_1"}) { value references { edges { node } } } } pageInfo { hasPreviousPage hasNextPage hasNextPage endCursor startCursor } } } } fragment ArticleItem on Article { author: authorV2 { name } contentHtml handle id image { id altText url width height } publishedAt title blog { handle } }
My metafields include:
misc_content_long_text_1
misc_content_long_text_2
misc_content_long_text_3
misc_text_field_1
misc_text_field_2
misc_text_field_3
misc_text_field_4
misc_text_field_5
I'm hoping I don't have to call multiple queries to fetch those. TIA
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025