Help with data models
Hello im new to this and im having a hard time fetching data from a data model and displaying it onto a theme app extension any idea where to start
3 Replies
You have two ways to do this:
1- Setup a route and have this route beying queried by your theme app extension (I do not recommend this option)
https://docs.gadget.dev/guides/http-routes/route-configuration
In this scenario data flows as: Gadget -> Shop front end
2- Setting up a metafield and using the metafield within you theme app extension (best option in most cases)
https://docs.gadget.dev/guides/plugins/shopify/metafields-metaobjects#creating-a-relationship-to-a-custom-model
In this scenario data flows as: Gadget -> Shopify metafields -> Shop front end
does this connect like for each individual store i want it so each store can set there own data i dont want it to be global for everyone
Depends on your setup, but metafiels are individual for each store. If you need a global one then maybe the routes would be a better solution