So I'd like to let users define metafields in the settings of the app so they can retrieve data for their products. This will then mean they can use the data to filter in my UI.
I obviously won't be able to create fields programatically for each metafield so I'm thinking I just create a JSON field against the product model and store them all in here. I would most likely restrict metafields to single line text/integer etc.
My question here is how can I retrieve this data on updates when it will differ for each store? My only thinking at the moment is inside the
update
update
action I would need to hit the shopify admin api retrieving the metafields for that program, then update the record (perhaps I do this in the
run
run
function so we can update the field before its saved?
But this would mean request time would jump drastically because I'd be hitting the admin api every single time the update action runs.