Hi, I am new to Shopify App development, and am using APPBRIDGE to build my embedded app based on THIS tutorial.
My app has a requirement to store some global app settings in the shop’s Metafields. I had been planning to use GraphQL for the whole app, but discovered that this functionality is only available via the REST interface:
POST /admin/metafields.json
Can someone share how I can make these REST calls given the above technology stack?
I’ll skip your question for the moment and ask you another. What data do you need to store in a shop metafield? Metafields are not a protected resource so if you’re storing critical settings in there keep in mind another app/tool could alter or delete them. If that’s a problem then metafields are not the right place for that data.
There certainly could be some app devs out there that don’t want to store app specific data on their own servers. I hope none do as it’s a poor/risky approach given how quick it is to spin up some form of db app side. It also creates garbage in the shops metafield data come uninstallation time. Your app may be removed but the metafield will still remain.