Hi,
I'm not sure if this is directly related to Polaris but hopefully I may reach some members of the app team.
You have recently introduced collection and product picker. While this is a huge step forward, it suffers from many limitations:
Currently, searching or exposing basic info about resources the app had access based on their permissions has always been a huge issue. We either need to proxy to Shopify server, which is slow and limited (for instance Products API do not have any endpoint to get by arbitrary query), or simply duplicating all the data into our servers, which can become quite expensive and complex. Or even installing search templates into the store, but which is not an optimal solution neither.
The theme theme recently introduced a very simple endpoint to power the new URL type, which looks like this:

And can return basic information about all public Shopify resources (articles, blogs, collections, products and pages).
This is a huge feature and it would make a lot of sense to have such endpoints (that would be scoped by permissions the app has, obviously). This would allow to create more responsive interfaces, without requiring to index all the data in our own servers (which may not be desirable), and ultimately give a lot of flexibiltiy to app developers, adn being to add more useful component to Polaris.
I hope that such endpoints could be introduced in the near future :).
Thanks!
I haven't seen any documentation on "/admin/url_settings.json".
After reading this post I've started poking at it. Seems interesting.
Haha I've just inspected the Ajax calls in the admin :hacker_mind: !
Hey Bakura,
Not sure that I'm understanding the value add that you get from using url_settings rather than the APIs that were designed to fetch the resources that you need.
~We also have a Storefront API that may help you with some of the resources that you need.~ Now that I understand the question, the Storefront API is definitely _not_ what you need 馃槢
Hey !
I've tried Storefront API but it has several issues with typical usage in apps: it's limited to products and collections (at the moment) and more importantly, it creates a new "sales channel" actually, so the emrchant would need to manually check all the products to be visible to the storefront API to be fetched.
I think it would be very nice if the SDK would offer a nice API to fetch authorized resources (so for instance if you have read_products and read_content permissions your app could get products, pages and articles).
As said in my introduction this has been a major difficulty for us (and likely many app developers) to not being able to get products, collections, pages... in JS. The REST API is limited (for instance products, collections, articles... do not support arbitrary search query).
The url_settings endpoint is limited (it only returns a very limited subset of info) but at least it could be used to perform basic search and autocompletion in app.
How other developers are handling this actually? A lot of apps in Shopify end up being fetching resources in one way or another, and I've not been able to find a perfect solution yet. Adding this would definitely add a lot of value to the SDK :).
The REST API is limited (for instance products, collections, articles... do not support arbitrary search query
Search is something that a lot of people would benefit from, and is likely the first thing that we'd end up improving. I'd caution against using anything undocumented, especially if you're highjacking an admin session or something to do what you want. For the time being, sticking to the suggested endpoints and indexing the data on your servers (if required) is the best path forward.
Most helpful comment
Haha I've just inspected the Ajax calls in the admin :hacker_mind: !