Hello everyone!
Im working on a page template to display all collections in a store. There’s like 1600 collections. I need to paginate only the collections that have a certain metafield populated. {% paginate %} liquid wont let me paginate a custom array so I discarded this option. Also, paginating and then excluding collection with an if statement will leave me with ton of empty pages, since the exclusion occurs after the pagination liquid method.
I went with creating a Storefront access token (custom app) to grab every collection with the metafield populated. This works, but, it has at least two issues:
1: Dont know how to hash or hide the Storefront Access Token since Im applying the script in a section liquid file.
2: I think this will still be demanding in terms of performance.
3: Is a backend proxy app the only solution for this?
If you have a backend proxy app, you should be able to store the token as a metafield and access the token without it being exposed to the front-end. There could be an issue with performance but if you’re only querying the exact data you need, it will be as efficient as possible.
Thank you for answer Liam! I really appreciate it.
So the only option here is to create a backend proxy app to query the exact collections I want, right? There’s no storefront/liquid-native solution?
Correct - there would not be a native Liquid solution for this.
1 Like
Hey there Liam, Im working on a custom remix app, then creating running theme app extension, trying to add this Query (that loops collections with a certain metafield) inside an extension app block from my custom app. Is this procedure a good approach? Still figuring out how to hide the access token here, or where to apply the graphiql query request (extension block or where?)
Im trying to figure how to accomplish your recommendation → “store the token as a metafield and access the token without it being exposed to the front-end”
Thank you for all your help here