Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
It seems that when using Flow, there are two ways to fetch a specific metafield:
1. Doing a liquid loop through all the resource's metafields and checking each one's key and namespace
2. Using the "run code" functionality, request the resource's metafields and then use .find() in Javascript on the returned array. It seems you can't filter metafields within the GraphQL query.
My questions are, am I missing any other options? And secondly, are there performance issues to be worried about in the case the resource has a large amount of large metafields?
Option 2 has been working fine for me, but my concern is that I store potentially large JSON files (the maximum size is 2 million characters so why not?) as metafields on variants and I'm wondering if this could cause Flow to timeout or fail even if I'm just trying to access a smaller metafield.
This is a Flow question not a general API question.
Those are both about the same performance as they will fetch all of the fields that you use in your code/liquid
We have an update for metafields coming very soon that will allow fetching each metafields one-by-one, which we prioritized because of the performance issues in looping and the growing size of metafields.
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024